Skip to content

Commit 5c22d13

Browse files
Add check
1 parent 2620394 commit 5c22d13

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Python/optimizer.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,9 @@ translate_bytecode_to_trace(
805805
if (opcode == CALL_ALLOC_AND_ENTER_INIT) {
806806
// In CALL_ALLOC_AND_ENTER_INIT, func_version is actually the type version.
807807
PyTypeObject *typ = _PyType_LookupByVersion(func_version);
808-
if (typ == NULL || !PyType_HasFeature(typ, Py_TPFLAGS_HEAPTYPE)) {
808+
if (typ == NULL ||
809+
!PyType_HasFeature(typ, Py_TPFLAGS_HEAPTYPE) ||
810+
!PyType_HasFeature(typ, Py_TPFLAGS_INLINE_VALUES)) {
809811
DPRINTF(2, "Bailing due to dynamic target\n");
810812
ADD_TO_TRACE(uop, oparg, 0, target);
811813
ADD_TO_TRACE(_EXIT_TRACE, 0, 0, 0);

0 commit comments

Comments
 (0)