Skip to content

Commit a578fb2

Browse files
committed
Fix specilisation fail for subclasses
Do TypeCheck instead of IsType in the guard
1 parent 952d8fb commit a578fb2

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

‎Modules/_testinternalcapi/test_cases.c.h‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Python/bytecodes.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5060,7 +5060,7 @@ dummy_func(
50605060
EXIT_IF(total_args != 2);
50615061
PyObject *self = PyStackRef_AsPyObjectBorrow(
50625062
PyStackRef_IsNull(self_or_null) ? args[0] : self_or_null);
5063-
EXIT_IF(!Py_IS_TYPE(self, method->d_common.d_type));
5063+
EXIT_IF(!PyObject_TypeCheck(self, method->d_common.d_type));
50645064
}
50655065

50665066
op(_CALL_METHOD_DESCRIPTOR_O, (callable, self_or_null, args[oparg] -- res, c, s, a)) {
@@ -5137,7 +5137,7 @@ dummy_func(
51375137
}
51385138
EXIT_IF(total_args == 0);
51395139
PyObject *self = PyStackRef_AsPyObjectBorrow(arguments[0]);
5140-
EXIT_IF(!Py_IS_TYPE(self, method->d_common.d_type));
5140+
EXIT_IF(!PyObject_TypeCheck(self, method->d_common.d_type));
51415141
}
51425142

51435143
op(_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS, (callable, self_or_null, args[oparg] -- callable, self_or_null, args[oparg])) {
@@ -5211,7 +5211,7 @@ dummy_func(
52115211
EXIT_IF(total_args != 1);
52125212
PyObject *self = PyStackRef_AsPyObjectBorrow(
52135213
PyStackRef_IsNull(self_or_null) ? args[0] : self_or_null);
5214-
EXIT_IF(!Py_IS_TYPE(self, method->d_common.d_type));
5214+
EXIT_IF(!PyObject_TypeCheck(self, method->d_common.d_type));
52155215
}
52165216

52175217
op(_CALL_METHOD_DESCRIPTOR_NOARGS, (callable, self_or_null, args[oparg] -- res, c, s)) {
@@ -5281,7 +5281,7 @@ dummy_func(
52815281
EXIT_IF(total_args == 0);
52825282
PyObject *self = PyStackRef_AsPyObjectBorrow(
52835283
PyStackRef_IsNull(self_or_null) ? args[0] : self_or_null);
5284-
EXIT_IF(!Py_IS_TYPE(self, method->d_common.d_type));
5284+
EXIT_IF(!PyObject_TypeCheck(self, method->d_common.d_type));
52855285
}
52865286

52875287
op(_CALL_METHOD_DESCRIPTOR_FAST, (callable, self_or_null, args[oparg] -- callable, self_or_null, args[oparg])) {

‎Python/executor_cases.c.h‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Python/generated_cases.c.h‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)