com php-src: Fix ct binding for cuf/cufa functions: Zend/zend_compile.c
| From: | Nikita Popov | Date: | Tue, 23 Sep 2014 19:02:32 +0000 |
| Subject: | com php-src: Fix ct binding for cuf/cufa functions: Zend/zend_compile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81888@lists.php.net to get a copy of this message | ||
Commit: 67a5ca6697bde602bbcc4832f5865f84bc67504b
Author: Nikita Popov <nikic@php.net> Tue, 23 Sep 2014 21:02:32 +0200
Parents: 9070eb38e9c1d04c42590f4f7bda74e74c12029b
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=67a5ca6697bde602bbcc4832f5865f84bc67504b
Log:
Fix ct binding for cuf/cufa functions
It was checking against the wrong AST kind, so the binding was
never actually done.
Changed paths:
M Zend/zend_compile.c
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 73f6a8b..59a5ce8 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2646,7 +2646,7 @@ static int zend_try_compile_ct_bound_init_user_func(znode *result, zend_ast
*nam
zend_function *fbc;
zend_op *opline;
- if (name_ast->kind != ZEND_AST_CONST || Z_TYPE_P(zend_ast_get_zval(name_ast)) != IS_STRING) {
+ if (name_ast->kind != ZEND_AST_ZVAL || Z_TYPE_P(zend_ast_get_zval(name_ast)) != IS_STRING) {
return FAILURE;
}
@@ -2663,9 +2663,11 @@ static int zend_try_compile_ct_bound_init_user_func(znode *result, zend_ast
*nam
}
opline = zend_emit_op(NULL, ZEND_INIT_FCALL, NULL, NULL TSRMLS_CC);
+ opline->extended_value = num_args;
+
opline->op2_type = IS_CONST;
LITERAL_STR(opline->op2, lcname);
- opline->extended_value = num_args;
+ zend_alloc_cache_slot(opline->op2.constant TSRMLS_CC);
return SUCCESS;
}