From: Zeev Suraski Date: Wed, 3 Jan 2001 23:00:01 +0000 (+0000) Subject: Fix another case of possible line number corruption X-Git-Tag: php-4.0.5RC1~743 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3258b2426e1c8e66a0cc335fb1839de98c12451;p=php Fix another case of possible line number corruption --- diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index 5153276089..56e4d27f21 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -354,7 +354,6 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS CG(active_op_array) = op_array; compiler_result = zendparse(CLS_C); zend_do_return(&retval_znode, 0 CLS_CC); - restore_lexical_state(&original_lex_state CLS_CC); CG(in_compilation) = original_in_compilation; if (compiler_result==1) { /* parser error */ CG(unclean_shutdown) = 1; @@ -372,6 +371,9 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS retval = NULL; } } + if (compilation_successful) { + restore_lexical_state(&original_lex_state CLS_CC); + } return retval; }