summaryrefslogtreecommitdiff
path: root/Lib/php
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2022-01-24 13:32:22 +1300
committerOlly Betts <olly@survex.com>2022-01-24 13:32:22 +1300
commit5f5a8f2d4a097474e0b4f2c94cc8d457f873e1b1 (patch)
tree7b033020e7d7b40fe70ec01a7f6379c6f026c466 /Lib/php
parent901d1fc06192d7b35054ad1651ca6358bf764224 (diff)
downloadswig-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.
Diffstat (limited to 'Lib/php')
-rw-r--r--Lib/php/php.swg2
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);
%}