diff options
| author | Nikita Popov <nikic@php.net> | 2014-05-29 11:17:33 +0200 |
|---|---|---|
| committer | Nikita Popov <nikic@php.net> | 2014-05-29 11:17:33 +0200 |
| commit | 47e85b1b354bae083e51bce7396d1a2ac1c77161 (patch) | |
| tree | d7fef8d792e43f408f06be86057bb2252b25fef8 /Zend/zend_execute.c | |
| parent | d9a35c7e97da5583c28d2799d64a6fccdf855622 (diff) | |
| download | php-git-47e85b1b354bae083e51bce7396d1a2ac1c77161.tar.gz | |
Improve class constant fetch fix
Dereference the cached constant for Test::TEST as well (and not just
self::TEST).
Also improve the phpt file to test this case as well - previously
this only manifested with opcache enabled, due to literal sharing.
Additionally the Z_TYPE_P != IS_REFERENCE assertion is now moved
into the TMP_VAR fetching code (as it applies to more than just
property assignments.)
Diffstat (limited to 'Zend/zend_execute.c')
| -rw-r--r-- | Zend/zend_execute.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 9cc0f3a4cf..ae66364aa9 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -147,8 +147,10 @@ ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute static zend_always_inline zval *_get_zval_ptr_tmp(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC) { zval *ret = EX_VAR(var); - should_free->var = ret; + + ZEND_ASSERT(Z_TYPE_P(ret) != IS_REFERENCE); + return ret; } @@ -724,7 +726,6 @@ static inline void zend_assign_to_object(zval *retval, zval *object_ptr, zval *p /* separate our value if necessary */ if (value_type == IS_TMP_VAR) { - ZEND_ASSERT(Z_TYPE_P(value) != IS_REFERENCE); ZVAL_COPY_VALUE(&tmp, value); value = &tmp; } else if (value_type == IS_CONST) { |
