summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2021-04-22 07:42:39 +1200
committerOlly Betts <olly@survex.com>2021-04-22 07:42:39 +1200
commit50b13275dc8df83de4558387005fd026ac4eaa49 (patch)
treeb5f6bcfbcb139965aa9e04dac14d465d504d264b
parent5e2114501f0aa37c8692800cc28dc392f104fec1 (diff)
downloadswig-50b13275dc8df83de4558387005fd026ac4eaa49.tar.gz
Fix mixed declarations and code
-rw-r--r--Lib/php/phprun.swg3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/php/phprun.swg b/Lib/php/phprun.swg
index a1eeb3aae..cad0f840c 100644
--- a/Lib/php/phprun.swg
+++ b/Lib/php/phprun.swg
@@ -102,6 +102,7 @@ SWIG_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject) {
{
zend_object *obj;
+ swig_object_wrapper *value;
if (Z_TYPE_P(z) == IS_OBJECT) {
/* The PHP object is already initialised - this is the case when wrapping
* the return value from a PHP constructor. */
@@ -111,7 +112,7 @@ SWIG_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject) {
obj = ce->create_object(ce);
ZVAL_OBJ(z, obj);
}
- swig_object_wrapper *value = php_fetch_object(obj);
+ value = php_fetch_object(obj);
value->ptr = ptr;
value->newobject = (newobject & 1);
value->type = type;