diff options
author | Olly Betts <olly@survex.com> | 2022-01-24 13:32:22 +1300 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2022-01-24 13:32:22 +1300 |
commit | 5f5a8f2d4a097474e0b4f2c94cc8d457f873e1b1 (patch) | |
tree | 7b033020e7d7b40fe70ec01a7f6379c6f026c466 | |
parent | 901d1fc06192d7b35054ad1651ca6358bf764224 (diff) | |
download | swig-5f5a8f2d4a097474e0b4f2c94cc8d457f873e1b1.tar.gz |
[php] Initialise zval in directorin typemaps
SWIG_SetPointerZval() requires the zval structure passed to be
initialised (so it can handle the constructor case where the zval is
already initialised as a PHP object.
I couldn't think of a suitable regression test for this, but it fixes 2
issues detected by running director_basic under valgrind.
-rw-r--r-- | Lib/php/php.swg | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/php/php.swg b/Lib/php/php.swg index 1120f226e..981e4679b 100644 --- a/Lib/php/php.swg +++ b/Lib/php/php.swg @@ -419,6 +419,7 @@ SWIGTYPE &, SWIGTYPE && %{ + ZVAL_UNDEF($input); SWIG_SetPointerZval($input, (void *)&$1, $1_descriptor, $owner); %} @@ -460,6 +461,7 @@ %typemap(directorin) SWIGTYPE %{ + ZVAL_UNDEF($input); SWIG_SetPointerZval($input, SWIG_as_voidptr(new $1_ltype((const $1_ltype &)$1)), $&1_descriptor, 1); %} |