From 77d4879db9c05c1e91f466e4732a73f6e1864a98 Mon Sep 17 00:00:00 2001 From: Reeze Xia Date: Thu, 16 Aug 2012 21:46:41 +0800 Subject: [PATCH] Fix segfault when checking goto in finally if resolve was delayed to runtime This fixed the following two tests failed: - Zend/tests/exception_002.phpt - Zend/tests/jump13.phpt --- Zend/zend_compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 378cf17bffabf..60f0c37bc0667 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2278,8 +2278,8 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 Z_TYPE_P(label) = IS_NULL; if (op_array->last_try_catch) { - zend_uint i, op_num = opline - CG(active_op_array)->opcodes; - for (i=0; ilast_try_catch; i++) { + zend_uint i, op_num = opline - op_array->opcodes; + for (i=0; i < op_array->last_try_catch; i++) { if (op_array->try_catch_array[i].try_op > op_num) { break; }