]> granicus.if.org Git - php/commitdiff
Fixed context info in error message
authorXinchen Hui <laruence@php.net>
Fri, 17 Aug 2012 13:18:20 +0000 (21:18 +0800)
committerXinchen Hui <laruence@php.net>
Fri, 17 Aug 2012 13:18:20 +0000 (21:18 +0800)
Zend/zend_compile.c

index d7ca6eab33f6fe281416e4685cc2f31506d3554c..bad9411a2f46fb42da8181c57d259a316a0c9f9b 100644 (file)
@@ -2289,6 +2289,11 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2
                                end = op_array->opcodes + opline->op1.opline_num;
                                while (++p < end) {
                                        if (p->opcode == ZEND_LEAVE) {
+                                               if (pass2) {
+                                                       CG(in_compilation) = 1;
+                                                       CG(active_op_array) = op_array;
+                                                       CG(zend_lineno) = opline->lineno;
+                                               }
                                                zend_error(E_COMPILE_ERROR, "'goto' out of a finally block is disallowed");
                                        }
                                }