@@ -6591,7 +6591,8 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
6591
6591
op_array_ssa = & jit_extension -> func_info .ssa ;
6592
6592
top = frame ;
6593
6593
if (frame -> prev ) {
6594
- checked_stack -= frame -> used_stack ;
6594
+ checked_stack = frame -> old_checked_stack ;
6595
+ peek_checked_stack = frame -> old_peek_checked_stack ;
6595
6596
frame = frame -> prev ;
6596
6597
stack = frame -> stack ;
6597
6598
ZEND_ASSERT (& frame -> func -> op_array == op_array );
@@ -6764,24 +6765,40 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
6764
6765
}
6765
6766
}
6766
6767
}
6768
+ call -> old_checked_stack = checked_stack ;
6769
+ call -> old_peek_checked_stack = peek_checked_stack ;
6767
6770
if (p -> info & ZEND_JIT_TRACE_FAKE_INIT_CALL ) {
6768
6771
frame -> call_level ++ ;
6769
- call -> used_stack = 0 ;
6772
+ call -> used_stack = checked_stack = peek_checked_stack = 0 ;
6770
6773
} else {
6771
6774
if (p -> func ) {
6772
6775
call -> used_stack = zend_vm_calc_used_stack (init_opline -> extended_value , (zend_function * )p -> func );
6773
6776
} else {
6774
6777
call -> used_stack = (ZEND_CALL_FRAME_SLOT + init_opline -> extended_value ) * sizeof (zval );
6775
6778
}
6776
- checked_stack += call -> used_stack ;
6777
- if (checked_stack > peek_checked_stack ) {
6778
- peek_checked_stack = checked_stack ;
6779
+ switch (init_opline -> opcode ) {
6780
+ case ZEND_INIT_FCALL :
6781
+ case ZEND_INIT_FCALL_BY_NAME :
6782
+ case ZEND_INIT_NS_FCALL_BY_NAME :
6783
+ case ZEND_INIT_METHOD_CALL :
6784
+ case ZEND_INIT_DYNAMIC_CALL :
6785
+ //case ZEND_INIT_STATIC_METHOD_CALL:
6786
+ //case ZEND_INIT_USER_CALL:
6787
+ //case ZEND_NEW:
6788
+ checked_stack += call -> used_stack ;
6789
+ if (checked_stack > peek_checked_stack ) {
6790
+ peek_checked_stack = checked_stack ;
6791
+ }
6792
+ break ;
6793
+ default :
6794
+ checked_stack = peek_checked_stack = 0 ;
6779
6795
}
6780
6796
}
6781
6797
} else if (p -> op == ZEND_JIT_TRACE_DO_ICALL ) {
6782
6798
call = frame -> call ;
6783
6799
if (call ) {
6784
- checked_stack -= call -> used_stack ;
6800
+ checked_stack = call -> old_checked_stack ;
6801
+ peek_checked_stack = call -> old_peek_checked_stack ;
6785
6802
top = call ;
6786
6803
frame -> call = call -> prev ;
6787
6804
}
0 commit comments