@@ -7125,6 +7125,8 @@ static void zend_compile_match(znode *result, zend_ast *ast)
71257125 zend_ast * arm_ast = arms -> child [i ];
71267126 zend_ast * body_ast = arm_ast -> child [1 ];
71277127
7128+ CG (zend_lineno ) = zend_ast_get_lineno (arm_ast );
7129+
71287130 if (arm_ast -> child [0 ] != NULL ) {
71297131 zend_ast_list * conds = zend_ast_get_list (arm_ast -> child [0 ]);
71307132
@@ -10728,6 +10730,8 @@ static void zend_compile_binary_op(znode *result, zend_ast *ast) /* {{{ */
1072810730 zend_compile_expr (& left_node , left_ast );
1072910731 zend_compile_expr (& right_node , right_ast );
1073010732
10733+ CG (zend_lineno ) = ast -> lineno ;
10734+
1073110735 if (left_node .op_type == IS_CONST && right_node .op_type == IS_CONST ) {
1073210736 if (zend_try_ct_eval_binary_op (& result -> u .constant , opcode ,
1073310737 & left_node .u .constant , & right_node .u .constant )
@@ -12327,9 +12331,6 @@ static void zend_compile_stmt(zend_ast *ast) /* {{{ */
1232712331
1232812332static void zend_compile_expr_inner (znode * result , zend_ast * ast ) /* {{{ */
1232912333{
12330- /* CG(zend_lineno) = ast->lineno; */
12331- CG (zend_lineno ) = zend_ast_get_lineno (ast );
12332-
1233312334 if (CG (memoize_mode ) != ZEND_MEMOIZE_NONE ) {
1233412335 zend_compile_memoized_expr (result , ast , BP_VAR_R );
1233512336 return ;
@@ -12468,6 +12469,9 @@ static void zend_compile_expr(znode *result, zend_ast *ast)
1246812469{
1246912470 zend_check_stack_limit ();
1247012471
12472+ uint32_t prev_lineno = CG (zend_lineno );
12473+ CG (zend_lineno ) = zend_ast_get_lineno (ast );
12474+
1247112475 uint32_t checkpoint = zend_short_circuiting_checkpoint ();
1247212476 zend_compile_expr_inner (result , ast );
1247312477 zend_short_circuiting_commit (checkpoint , result , ast );
@@ -12477,12 +12481,12 @@ static void zend_compile_expr(znode *result, zend_ast *ast)
1247712481 ZEND_ASSERT (result -> op_type != IS_VAR );
1247812482 }
1247912483#endif
12484+
12485+ CG (zend_lineno ) = prev_lineno ;
1248012486}
1248112487
1248212488static zend_op * zend_compile_var_inner (znode * result , zend_ast * ast , uint32_t type , bool by_ref )
1248312489{
12484- CG (zend_lineno ) = zend_ast_get_lineno (ast );
12485-
1248612490 if (CG (memoize_mode ) != ZEND_MEMOIZE_NONE ) {
1248712491 switch (ast -> kind ) {
1248812492 case ZEND_AST_CALL :
@@ -12543,6 +12547,9 @@ static zend_op *zend_compile_var(znode *result, zend_ast *ast, uint32_t type, bo
1254312547{
1254412548 zend_check_stack_limit ();
1254512549
12550+ uint32_t prev_lineno = CG (zend_lineno );
12551+ CG (zend_lineno ) = zend_ast_get_lineno (ast );
12552+
1254612553 uint32_t checkpoint = zend_short_circuiting_checkpoint ();
1254712554 zend_op * opcode = zend_compile_var_inner (result , ast , type , by_ref );
1254812555 zend_short_circuiting_commit (checkpoint , result , ast );
@@ -12556,32 +12563,47 @@ static zend_op *zend_compile_var(znode *result, zend_ast *ast, uint32_t type, bo
1255612563 ZEND_ASSERT (result -> op_type != IS_VAR );
1255712564 }
1255812565#endif
12566+
12567+ CG (zend_lineno ) = prev_lineno ;
12568+
1255912569 return opcode ;
1256012570}
1256112571
1256212572static zend_op * zend_delayed_compile_var (znode * result , zend_ast * ast , uint32_t type , bool by_ref ) /* {{{ */
1256312573{
1256412574 zend_check_stack_limit ();
1256512575
12576+ uint32_t prev_lineno = CG (zend_lineno );
12577+ CG (zend_lineno ) = zend_ast_get_lineno (ast );
12578+
12579+ zend_op * opline ;
1256612580 switch (ast -> kind ) {
1256712581 case ZEND_AST_VAR :
12568- return zend_compile_simple_var (result , ast , type , true);
12582+ opline = zend_compile_simple_var (result , ast , type , true);
12583+ break ;
1256912584 case ZEND_AST_DIM :
12570- return zend_delayed_compile_dim (result , ast , type , by_ref );
12585+ opline = zend_delayed_compile_dim (result , ast , type , by_ref );
12586+ break ;
1257112587 case ZEND_AST_PROP :
1257212588 case ZEND_AST_NULLSAFE_PROP :
1257312589 {
12574- zend_op * opline = zend_delayed_compile_prop (result , ast , type );
12590+ opline = zend_delayed_compile_prop (result , ast , type );
1257512591 if (by_ref ) {
1257612592 opline -> extended_value |= ZEND_FETCH_REF ;
1257712593 }
12578- return opline ;
12594+ break ;
1257912595 }
1258012596 case ZEND_AST_STATIC_PROP :
12581- return zend_compile_static_prop (result , ast , type , by_ref , true);
12597+ opline = zend_compile_static_prop (result , ast , type , by_ref , true);
12598+ break ;
1258212599 default :
12583- return zend_compile_var (result , ast , type , false);
12600+ opline = zend_compile_var (result , ast , type , false);
12601+ break ;
1258412602 }
12603+
12604+ CG (zend_lineno ) = prev_lineno ;
12605+
12606+ return opline ;
1258512607}
1258612608/* }}} */
1258712609
0 commit comments