From: Richard Jones Date: Sun, 11 Jul 2010 22:32:14 +0000 (+0100) Subject: perl: Fix generated XS code for value_dword binding. X-Git-Tag: 1.2.3~6 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=c94240fad3f6bc1befc1c7ba6de253555a58dce3;p=hivex.git perl: Fix generated XS code for value_dword binding. Thanks to Hilko Bengen for spotting the problem. --- 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";