[PHP] Fix out typemap for member function pointers

The existing typemap was just broken - it correctly created the resource
and then did nothing with it, and instead tried to register the member
pointer as a normal pointer, which is never going to work as it's larger
than a normal pointer.

Add cpp_basic_runme.php as a regression test for this.
This commit is contained in:
Olly Betts 2016-09-02 09:51:18 +12:00
commit a4015acaca
3 changed files with 24 additions and 5 deletions

View file

@ -393,11 +393,7 @@
{
void * p = emalloc(sizeof($1));
memcpy(p, &$1, sizeof($1));
zval * resource;
MAKE_STD_ZVAL(resource);
ZEND_REGISTER_RESOURCE(resource, p, swig_member_ptr);
SWIG_SetPointerZval(return_value, (void *)&$1, $1_descriptor, $owner);
ZEND_REGISTER_RESOURCE(return_value, p, swig_member_ptr);
}
%typemap(in, fragment="swig_php_init_member_ptr") SWIGTYPE (CLASS::*)