@@ -325,6 +325,7 @@ void zend_oparray_context_begin(zend_oparray_context *prev_context) /* {{{ */
325
325
CG (context ).last_brk_cont = 0 ;
326
326
CG (context ).brk_cont_array = NULL ;
327
327
CG (context ).labels = NULL ;
328
+ CG (context ).in_jmp_frameless_branch = false;
328
329
}
329
330
/* }}} */
330
331
@@ -4630,7 +4631,9 @@ static void zend_compile_ns_call(znode *result, znode *name_node, zend_ast *args
4630
4631
/* Find frameless function with same name. */
4631
4632
zend_function * frameless_function = NULL ;
4632
4633
if (args_ast -> kind != ZEND_AST_CALLABLE_CONVERT
4633
- && !zend_args_contain_unpack_or_named (zend_ast_get_list (args_ast ))) {
4634
+ && !zend_args_contain_unpack_or_named (zend_ast_get_list (args_ast ))
4635
+ /* Avoid blowing up op count with nested frameless branches. */
4636
+ && !CG (context ).in_jmp_frameless_branch ) {
4634
4637
zend_string * lc_func_name = Z_STR_P (CT_CONSTANT_EX (CG (active_op_array ), name_constants + 2 ));
4635
4638
frameless_function = zend_hash_find_ptr (CG (function_table ), lc_func_name );
4636
4639
}
@@ -4641,6 +4644,7 @@ static void zend_compile_ns_call(znode *result, znode *name_node, zend_ast *args
4641
4644
if (frameless_function ) {
4642
4645
frameless_function_info = find_frameless_function_info (zend_ast_get_list (args_ast ), frameless_function , type );
4643
4646
if (frameless_function_info ) {
4647
+ CG (context ).in_jmp_frameless_branch = true;
4644
4648
znode op1 ;
4645
4649
op1 .op_type = IS_CONST ;
4646
4650
ZVAL_COPY (& op1 .u .constant , CT_CONSTANT_EX (CG (active_op_array ), name_constants + 1 ));
@@ -4670,6 +4674,8 @@ static void zend_compile_ns_call(znode *result, znode *name_node, zend_ast *args
4670
4674
zend_op * flf_icall = & CG (active_op_array )-> opcodes [flf_icall_opnum ];
4671
4675
SET_NODE (flf_icall -> result , result );
4672
4676
zend_update_jump_target_to_next (jmp_end_opnum );
4677
+
4678
+ CG (context ).in_jmp_frameless_branch = false;
4673
4679
}
4674
4680
}
4675
4681
/* }}} */
0 commit comments