@@ -6578,7 +6578,8 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
6578
6578
op_array_ssa = & jit_extension -> func_info .ssa ;
6579
6579
top = frame ;
6580
6580
if (frame -> prev ) {
6581
- checked_stack -= frame -> used_stack ;
6581
+ checked_stack = frame -> old_checked_stack ;
6582
+ peek_checked_stack = frame -> old_peek_checked_stack ;
6582
6583
frame = frame -> prev ;
6583
6584
stack = frame -> stack ;
6584
6585
ZEND_ASSERT (& frame -> func -> op_array == op_array );
@@ -6751,24 +6752,40 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
6751
6752
}
6752
6753
}
6753
6754
}
6755
+ call -> old_checked_stack = checked_stack ;
6756
+ call -> old_peek_checked_stack = peek_checked_stack ;
6754
6757
if (p -> info & ZEND_JIT_TRACE_FAKE_INIT_CALL ) {
6755
6758
frame -> call_level ++ ;
6756
- call -> used_stack = 0 ;
6759
+ call -> used_stack = checked_stack = peek_checked_stack = 0 ;
6757
6760
} else {
6758
6761
if (p -> func ) {
6759
6762
call -> used_stack = zend_vm_calc_used_stack (init_opline -> extended_value , (zend_function * )p -> func );
6760
6763
} else {
6761
6764
call -> used_stack = (ZEND_CALL_FRAME_SLOT + init_opline -> extended_value ) * sizeof (zval );
6762
6765
}
6763
- checked_stack += call -> used_stack ;
6764
- if (checked_stack > peek_checked_stack ) {
6765
- peek_checked_stack = checked_stack ;
6766
+ switch (init_opline -> opcode ) {
6767
+ case ZEND_INIT_FCALL :
6768
+ case ZEND_INIT_FCALL_BY_NAME :
6769
+ case ZEND_INIT_NS_FCALL_BY_NAME :
6770
+ case ZEND_INIT_METHOD_CALL :
6771
+ case ZEND_INIT_DYNAMIC_CALL :
6772
+ //case ZEND_INIT_STATIC_METHOD_CALL:
6773
+ //case ZEND_INIT_USER_CALL:
6774
+ //case ZEND_NEW:
6775
+ checked_stack += call -> used_stack ;
6776
+ if (checked_stack > peek_checked_stack ) {
6777
+ peek_checked_stack = checked_stack ;
6778
+ }
6779
+ break ;
6780
+ default :
6781
+ checked_stack = peek_checked_stack = 0 ;
6766
6782
}
6767
6783
}
6768
6784
} else if (p -> op == ZEND_JIT_TRACE_DO_ICALL ) {
6769
6785
call = frame -> call ;
6770
6786
if (call ) {
6771
- checked_stack -= call -> used_stack ;
6787
+ checked_stack = call -> old_checked_stack ;
6788
+ peek_checked_stack = call -> old_peek_checked_stack ;
6772
6789
top = call ;
6773
6790
frame -> call = call -> prev ;
6774
6791
}
0 commit comments