lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r885653 - /lucene/lucy/trunk/boilerplater/lib/Boilerplater/Binding/Perl/Constructor.pm
Date Tue, 01 Dec 2009 02:16:18 GMT
Author: marvin
Date: Tue Dec  1 02:16:13 2009
New Revision: 885653

URL: http://svn.apache.org/viewvc?rev=885653&view=rev
Log:
Have Perl bindings for constructors that return NULL return undef rather than
segfault.

Modified:
    lucene/lucy/trunk/boilerplater/lib/Boilerplater/Binding/Perl/Constructor.pm

Modified: lucene/lucy/trunk/boilerplater/lib/Boilerplater/Binding/Perl/Constructor.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/boilerplater/lib/Boilerplater/Binding/Perl/Constructor.pm?rev=885653&r1=885652&r2=885653&view=diff
==============================================================================
--- lucene/lucy/trunk/boilerplater/lib/Boilerplater/Binding/Perl/Constructor.pm (original)
+++ lucene/lucy/trunk/boilerplater/lib/Boilerplater/Binding/Perl/Constructor.pm Tue Dec  1
02:16:13 2009
@@ -122,8 +122,13 @@
         $var_assignments
         $refcount_mods
         retval = $func_sym($name_list);
-        ST(0) = Lucy_Obj_To_Host(retval);
-        LUCY_DECREF(retval);
+        if (retval) {
+            ST(0) = (SV*)Lucy_Obj_To_Host(retval);
+            Lucy_Obj_Dec_RefCount(retval);
+        }
+        else {
+            ST(0) = newSV(0);
+        }
         sv_2mortal( ST(0) );
         XSRETURN(1);
     }



Mime
View raw message