From: Dmitry Stogov Date: Mon, 18 Feb 2008 14:30:25 +0000 (+0000) Subject: Made code opcode-cache friendly. (It is disallowed to change code during execution) X-Git-Tag: php-5.2.6RC1~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8187dbfa4d925c37c84101e1235aab51c3efdbf9;p=php Made code opcode-cache friendly. (It is disallowed to change code during execution) --- diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index b592d3f870..d6ec7060f2 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2144,7 +2144,6 @@ ZEND_METHOD(reflection_parameter, getDefaultValue) reflection_object *intern; parameter_reference *param; zend_op *precv; - zval *zv, zv_copy; METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); GET_REFLECTION_OBJECT_PTR(param); @@ -2164,10 +2163,12 @@ ZEND_METHOD(reflection_parameter, getDefaultValue) return; } - zv_copy = precv->op2.u.constant; - zv = &zv_copy; - zval_update_constant_ex(&zv, (void*)0, param->fptr->common.scope TSRMLS_CC); - RETURN_ZVAL(zv, 1, 1); + *return_value = precv->op2.u.constant; + INIT_PZVAL(return_value); + if (Z_TYPE_P(return_value) != IS_CONSTANT) { + zval_copy_ctor(return_value); + } + zval_update_constant_ex(&return_value, (void*)0, param->fptr->common.scope TSRMLS_CC); } /* }}} */