summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2003-12-17 14:45:59 +0000
committerDmitry Stogov <dmitry@php.net>2003-12-17 14:45:59 +0000
commit3c4cfd3ec82f5c5dc30f3008fc3466e52726adce (patch)
treec55eeeb0292f40c6a64209b9c4fcf57b0b44057a /Zend
parent20f73cd267a3c347bd3e3176afd4d83ce0679b52 (diff)
downloadphp-git-3c4cfd3ec82f5c5dc30f3008fc3466e52726adce.tar.gz
Dynamic function call from object's property was fixed
(See "tests/lang/bug24926.phpt" and "tests/lang/bug25652.phpt")
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_compile.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 7e7077a872..a6f8ecd909 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1194,9 +1194,16 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
return;
}
- last_op->opcode = ZEND_INIT_METHOD_CALL;
-
- left_bracket->u.constant.value.lval = ZEND_INIT_FCALL_BY_NAME;
+ if (last_op->opcode == ZEND_FETCH_OBJ_R) {
+ last_op->opcode = ZEND_INIT_METHOD_CALL;
+ left_bracket->u.constant.value.lval = ZEND_INIT_FCALL_BY_NAME;
+ } else {
+ zend_op* opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline->opcode = ZEND_INIT_FCALL_BY_NAME;
+ opline->op2 = *left_bracket;
+ opline->extended_value = 0;
+ SET_UNUSED(opline->op1);
+ }
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
zend_do_extended_fcall_begin(TSRMLS_C);