From aafc593eb5760c3811db73e870778148ee10b0e4 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 4 Aug 2005 14:04:36 +0000 Subject: [PATCH] Fixed possible memory corryption during compilation of --- Zend/zend_compile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 3e440a703f..f73c379312 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3469,7 +3469,8 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno is_variable = 1; } zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); - if (CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode == ZEND_FETCH_OBJ_W) { + if (CG(active_op_array)->last > 0 && + CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode == ZEND_FETCH_OBJ_W) { /* Only lock the container if we are fetching from a real container and not $this */ if (CG(active_op_array)->opcodes[CG(active_op_array)->last-1].op1.op_type == IS_VAR) { CG(active_op_array)->opcodes[CG(active_op_array)->last-1].extended_value |= ZEND_FETCH_ADD_LOCK; -- 2.50.1