mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed constant expressions in array indeces handling
This commit is contained in:
parent
3696e038e5
commit
3810b4ab4a
2 changed files with 7 additions and 5 deletions
|
@ -5908,9 +5908,8 @@ void zend_do_add_static_array_element(znode *result, znode *offset, const znode
|
|||
zend_string *key;
|
||||
//??? int len = sizeof(zend_ast *);
|
||||
//??? Z_TYPE(element) |= IS_CONSTANT_INDEX;
|
||||
Z_STR(offset->u.constant)->gc.u.v.flags |= IS_STR_AST;
|
||||
|
||||
key = STR_INIT((char*)Z_AST(offset->u.constant), sizeof(zend_ast*), 0);
|
||||
key = STR_INIT((char*)&Z_AST(offset->u.constant), sizeof(zend_ast*), 0);
|
||||
key->gc.u.v.flags |= IS_STR_AST;
|
||||
//??? key[len] = Z_TYPE(offset->u.constant);
|
||||
//??? key[len + 1] = 0;
|
||||
zend_symtable_update(Z_ARRVAL(result->u.constant), key, &element);
|
||||
|
|
|
@ -582,8 +582,11 @@ ZEND_API int zval_update_constant_ex(zval *p, void *arg, zend_class_entry *scope
|
|||
}
|
||||
|
||||
if (str_index->gc.u.v.flags & IS_STR_AST) {
|
||||
zend_ast_evaluate(&const_value, (zend_ast *)str_index->val, scope TSRMLS_CC);
|
||||
zend_ast_destroy((zend_ast *)str_index->val);
|
||||
zend_ast_ref *ast = *(zend_ast_ref **)str_index->val;
|
||||
|
||||
zend_ast_evaluate(&const_value, ast->ast, scope TSRMLS_CC);
|
||||
zend_ast_destroy(ast->ast);
|
||||
efree(ast);
|
||||
//???
|
||||
} 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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue