FAQ

svn commit: r885653 - /lucene/lucy/trunk/boilerplater/lib/Boilerplater/Binding/Perl/Constructor.pm

Marvin
Dec 1, 2009 at 2:16 am
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);
}
reply

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post

1 user in discussion

Marvin: 1 post