@@ -997,18 +997,26 @@ dummy_func(void) {
997997
998998 op (_INIT_CALL_BOUND_METHOD_EXACT_ARGS , (callable , self_or_null , unused [oparg ] -- callable , self_or_null , unused [oparg ])) {
999999 PyObject * bound_method = sym_get_probable_value (callable );
1000- self_or_null = sym_new_not_null (ctx );
10011000 if (bound_method != NULL && Py_TYPE (bound_method ) == & PyMethod_Type ) {
10021001 PyMethodObject * method = (PyMethodObject * )bound_method ;
10031002 callable = sym_new_not_null (ctx );
10041003 sym_set_recorded_value (callable , method -> im_func );
1004+ self_or_null = sym_new_not_null (ctx );
1005+ sym_set_recorded_value (self_or_null , method -> im_self );
10051006 }
10061007 else {
10071008 callable = sym_new_not_null (ctx );
1009+ self_or_null = sym_new_not_null (ctx );
10081010 }
10091011 }
10101012
10111013 op (_CHECK_FUNCTION_VERSION , (func_version /2 , callable , self_or_null , unused [oparg ] -- callable , self_or_null , unused [oparg ])) {
1014+ PyObject * func = sym_get_probable_value (callable );
1015+ if (func != NULL && PyFunction_Check (func ) &&
1016+ ((PyFunctionObject * )func )-> func_version == func_version ) {
1017+ _Py_BloomFilter_Add (dependencies , func );
1018+ sym_set_const (callable , func );
1019+ }
10121020 if (sym_get_func_version (callable ) == func_version ) {
10131021 REPLACE_OP (this_instr , _NOP , 0 , 0 );
10141022 }
@@ -1025,12 +1033,14 @@ dummy_func(void) {
10251033 uop_buffer_last (& ctx -> out_buffer )-> operand1 = (uintptr_t )method -> im_func ;
10261034 }
10271035 else {
1036+ // Guarding on the bound method, safe to promote.
10281037 PyObject * bound_method = sym_get_probable_value (callable );
10291038 if (bound_method != NULL && Py_TYPE (bound_method ) == & PyMethod_Type ) {
10301039 PyMethodObject * method = (PyMethodObject * )bound_method ;
10311040 PyObject * func = method -> im_func ;
10321041 if (PyFunction_Check (func ) &&
10331042 ((PyFunctionObject * )func )-> func_version == func_version ) {
1043+ _Py_BloomFilter_Add (dependencies , func );
10341044 sym_set_const (callable , bound_method );
10351045 }
10361046 }
0 commit comments