perl: Fix $h->value_value method when returning an empty value.
authorRichard Jones <rjones@redhat.com>
Thu, 25 Mar 2010 19:39:07 +0000 (19:39 +0000)
committerRichard Jones <rjones@redhat.com>
Thu, 25 Mar 2010 19:40:48 +0000 (19:40 +0000)
Previously this didn't correctly return an empty registry
value.  In this case the length argument to newSVpv would
be 0 which tells Perl to try to calculate the length (we
want newSVpvn instead).

generator/generator.ml

index 230b66b..96d198d 100755 (executable)
@@ -2439,7 +2439,7 @@ DESTROY (h)
               name;
             pr "      EXTEND (SP, 2);\n";
             pr "      PUSHs (sv_2mortal (newSViv (type)));\n";
-            pr "      PUSHs (sv_2mortal (newSVpv (r, len)));\n";
+            pr "      PUSHs (sv_2mortal (newSVpvn (r, len)));\n";
             pr "      free (r);\n";
 
         | RInt64 ->