From: Dmitry Stogov Date: Mon, 18 Feb 2008 14:31:01 +0000 (+0000) Subject: Made code opcode-cache friendly. (It is disallowed to change code during execution) X-Git-Tag: RELEASE_2_0_0a1~440 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f78649d8db1a7779436acbe88b7cb9492c308dcb;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 1b352cc9ae..afb7a565de 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2178,7 +2178,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); @@ -2198,10 +2197,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); } /* }}} */