]> granicus.if.org Git - php/commitdiff
Fixed FE_RESET/FE_FETCH bug.
authorDmitry Stogov <dmitry@php.net>
Mon, 7 Feb 2005 16:44:00 +0000 (16:44 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 7 Feb 2005 16:44:00 +0000 (16:44 +0000)
Now FE_RESET instruction takes jump-address from itself, not from the following FE_FETCH instruction.

Zend/zend_compile.c

index ca4171e8b8254466e9175571e71a3e5cb8168fcc..1b9bfe2bee2af80411953f2cd0c6285635252818 100644 (file)
@@ -3478,6 +3478,7 @@ void zend_do_foreach_end(znode *foreach_token TSRMLS_DC)
        SET_UNUSED(opline->op2);
 
        CG(active_op_array)->opcodes[foreach_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
+       CG(active_op_array)->opcodes[foreach_token->u.opline_num-1].op2.u.opline_num = get_next_op_number(CG(active_op_array)); /* FE_RESET */
 
        do_end_loop(foreach_token->u.opline_num TSRMLS_CC);