com php-src: More constant related fixes: Zend/zend_compile .c Zend/zend_execute_API.c

From: Date: Mon, 24 Feb 2014 11:49:15 +0000
Subject: com php-src: More constant related fixes: Zend/zend_compile .c Zend/zend_execute_API.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-77952@lists.php.net to get a copy of this message
Commit: 595fc4d901cbb69d2d4fe46508b7303ac62428b8 Author: Dmitry Stogov <dmitry@zend.com> Mon, 24 Feb 2014 15:49:15 +0400 Parents: abb57cc1c2a92e6bb4f6cc732521163b8d9a8e4f Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=595fc4d901cbb69d2d4fe46508b7303ac62428b8 Log: More constant related fixes Changed paths: M Zend/zend_compile.c M Zend/zend_execute_API.c Diff: diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index d74d0f7..c6136e2 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5890,6 +5890,9 @@ void zend_do_add_static_array_element(znode *result, znode *offset, const znode case IS_CONSTANT: //??? /* Ugly hack to denote that this value has a constant index */ Z_STR(offset->u.constant)->gc.u.v.flags |= IS_STR_CONSTANT; + if (Z_TYPE(offset->u.constant) & IS_CONSTANT_UNQUALIFIED) { + Z_STR(offset->u.constant)->gc.u.v.flags |= IS_STR_CONSTANT_UNQUALIFIED; + } //??? Z_TYPE(element) |= IS_CONSTANT_INDEX; //??? Z_STRVAL(offset->u.constant) = erealloc(Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3); //??? Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+1] = Z_TYPE(offset->u.constant); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 1a07443..28938e5 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -585,7 +585,7 @@ ZEND_API int zval_update_constant_ex(zval *p, void *arg, zend_class_entry *scope zend_ast_evaluate(&const_value, (zend_ast *)str_index->val, scope TSRMLS_CC); zend_ast_destroy((zend_ast *)str_index->val); //??? - } else if (!zend_get_constant_ex(str_index->val, str_index->len, &const_value, scope, 0 /*???str_index[str_index_len - 2]*/ TSRMLS_CC)) { + } else if (!zend_get_constant_ex(str_index->val, str_index->len, &const_value, scope, str_index->gc.u.v.flags TSRMLS_CC)) { char *actual, *str; const char *save = str_index->val; int len; @@ -611,10 +611,10 @@ ZEND_API int zval_update_constant_ex(zval *p, void *arg, zend_class_entry *scope if (save[0] == '\\') { ++save; } - if (str_index->gc.u.v.flags & IS_STR_CONSTANT_UNQUALIFIED) { + if (!(str_index->gc.u.v.flags & IS_STR_CONSTANT_UNQUALIFIED)) { zend_error(E_ERROR, "Undefined constant '%s'", save); } - zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", str_index, str_index); + zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", str, str); } if (str == str_index->val && len == str_index->len) { ZVAL_STR(&const_value, str_index);

« previous php.cvs (#77952) next »