Fix uses of uninitialised zval
SWIG_SetPointerZval() now checks if the passed zval is an object, so use ZVAL_UNDEF() before in cases where we create a zval to pass.
This commit is contained in:
parent
228b04974d
commit
542f6ca440
1 changed files with 2 additions and 0 deletions
|
|
@ -47,6 +47,7 @@
|
||||||
SWIGTYPE [] %{
|
SWIGTYPE [] %{
|
||||||
{
|
{
|
||||||
zval z;
|
zval z;
|
||||||
|
ZVAL_UNDEF(&z);
|
||||||
SWIG_SetPointerZval(&z, (void*)$value, $1_descriptor, 0);
|
SWIG_SetPointerZval(&z, (void*)$value, $1_descriptor, 0);
|
||||||
zval_copy_ctor(&z);
|
zval_copy_ctor(&z);
|
||||||
zend_declare_class_constant(SWIGTYPE_$class_ce, "$const_name", sizeof("$const_name") - 1, &z);
|
zend_declare_class_constant(SWIGTYPE_$class_ce, "$const_name", sizeof("$const_name") - 1, &z);
|
||||||
|
|
@ -90,6 +91,7 @@
|
||||||
SWIGTYPE &&,
|
SWIGTYPE &&,
|
||||||
SWIGTYPE [] {
|
SWIGTYPE [] {
|
||||||
zend_constant c;
|
zend_constant c;
|
||||||
|
ZVAL_UNDEF(&c.value);
|
||||||
SWIG_SetPointerZval(&c.value, (void*)$value, $1_descriptor, 0);
|
SWIG_SetPointerZval(&c.value, (void*)$value, $1_descriptor, 0);
|
||||||
zval_copy_ctor(&c.value);
|
zval_copy_ctor(&c.value);
|
||||||
c.name = zend_string_init("$symname", sizeof("$symname") - 1, 0);
|
c.name = zend_string_init("$symname", sizeof("$symname") - 1, 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue