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