cvs: ZendEngine2 / zend_compile.c
| From: | Dmitry Stogov | Date: | Wed, 17 Dec 2003 14:46:00 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2128@lists.php.net to get a copy of this message | ||
dmitry Wed Dec 17 09:46:00 2003 EDT
Modified files:
/ZendEngine2 zend_compile.c
Log:
Dynamic function call from object's property was fixed
(See "tests/lang/bug24926.phpt" and "tests/lang/bug25652.phpt")
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.503 ZendEngine2/zend_compile.c:1.504
--- ZendEngine2/zend_compile.c:1.503 Tue Dec 16 05:51:51 2003
+++ ZendEngine2/zend_compile.c Wed Dec 17 09:45:59 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.503 2003/12/16 10:51:51 stas Exp $ */
+/* $Id: zend_compile.c,v 1.504 2003/12/17 14:45:59 dmitry Exp $ */
#include "zend_language_parser.h"
#include "zend.h"
@@ -1194,9 +1194,16 @@
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);