]> granicus.if.org Git - php/commitdiff
Fixed bug #32981 (ReflectionMethod::getStaticVariables() causes apache2.0.54 seg...
authorDmitry Stogov <dmitry@php.net>
Wed, 17 Aug 2005 11:54:34 +0000 (11:54 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 17 Aug 2005 11:54:34 +0000 (11:54 +0000)
NEWS
Zend/zend_reflection_api.c
ext/reflection/php_reflection.c
ext/reflection/tests/bug32981.phpt

diff --git a/NEWS b/NEWS
index af32db5f40856b3042074a0d7d510395d52b9769..cc60b3527f6a435114147d543c3900076d26ceee 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -50,6 +50,8 @@ PHP                                                                        NEWS
 - Fixed bug #33558 (warning with nested calls to functions returning by
   reference). (Dmitry)
 - Fixed bug #33326 (Cannot build extensions with phpize on Macosx). (Jani)
+- Fixed bug #32981 (ReflectionMethod::getStaticVariables() causes apache2.0.54
+  seg fault). (Dmitry)
 - Fixed bug #32139 (SOAP client does not auto-handle base64 encoding). (Ilia)
 - Fixed bug #32010 (Memory leak in mssql_fetch_batch). (fmk)
 - Fixed bug #29334 (win32 mail() provides incorrect Date: header). (Jani)
index 2bbd91bc982db7735321a241eb699bbdfae625e6..89ed94e8a138bea210545817b6c631462a772485 100644 (file)
@@ -1373,6 +1373,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
        /* Return an empty array in case no static variables exist */
        array_init(return_value);
        if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) {
+               zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
                zend_hash_copy(Z_ARRVAL_P(return_value), fptr->op_array.static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *));
        }
 }
index 2bbd91bc982db7735321a241eb699bbdfae625e6..89ed94e8a138bea210545817b6c631462a772485 100644 (file)
@@ -1373,6 +1373,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
        /* Return an empty array in case no static variables exist */
        array_init(return_value);
        if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) {
+               zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
                zend_hash_copy(Z_ARRVAL_P(return_value), fptr->op_array.static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *));
        }
 }
index 298756e1470fbb059cb379e319b6cfe33c90797c..1f89ca682b6e9fbc3c885dc93e206e9a7e98f6ee 100755 (executable)
@@ -28,7 +28,7 @@ array(1) {
   [0]=>
   array(1) {
     ["enabled"]=>
-    UNKNOWN:0
+    bool(true)
   }
 }
 ===DONE===