From c94240fad3f6bc1befc1c7ba6de253555a58dce3 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Sun, 11 Jul 2010 23:32:14 +0100 Subject: [PATCH] perl: Fix generated XS code for value_dword binding. Thanks to Hilko Bengen for spotting the problem. --- generator/generator.ml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/generator/generator.ml b/generator/generator.ml index 03f8c20..5bd46ee 100755 --- a/generator/generator.ml +++ b/generator/generator.ml @@ -2421,7 +2421,6 @@ DESTROY (h) | RErrDispose -> assert false | RHive -> assert false - | RInt32 | RNode | RValue -> pr "PREINIT:\n"; @@ -2542,6 +2541,21 @@ DESTROY (h) pr " PUSHs (sv_2mortal (newSVpvn (r, len)));\n"; pr " free (r);\n"; + | RInt32 -> + pr "PREINIT:\n"; + pr " int32_t r;\n"; + pr " CODE:\n"; + pr " errno = 0;\n"; + pr " r = hivex_%s (%s);\n" + name (String.concat ", " c_params); + free_args (); + pr " if (r == -1 && errno != 0)\n"; + pr " croak (\"%%s: %%s\", \"%s\", strerror (errno));\n" + name; + pr " RETVAL = newSViv (r);\n"; + pr " OUTPUT:\n"; + pr " RETVAL\n" + | RInt64 -> pr "PREINIT:\n"; pr " int64_t r;\n"; -- 1.8.3.1