From: Andi Gutmans Date: Tue, 20 Apr 2004 14:14:55 +0000 (+0000) Subject: - Fix bug #27283 - Exceptions where the last catch() statement was sometimes X-Git-Tag: php-5.0.0RC2RC2~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=173782b73e944cfdd8af1dfe67746df8b4e2ac03;p=php - Fix bug #27283 - Exceptions where the last catch() statement was sometimes - skipped. --- diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index c4ebaa6940..6d85f8be7a 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -229,8 +229,13 @@ additional_catches: ; non_empty_additional_catches: - non_empty_additional_catches T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$2, &$4, &$6, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$2 TSRMLS_CC); } - | T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$5, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); } + additional_catch { $$ = $1; } + | non_empty_additional_catches additional_catch { $$ = $2; } +; + + +additional_catch: + T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$5, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); } ;