Skip to content

JIT: missing type watcher in _CHECK_ATTR_CLASS #148398

@NekoAsakura

Description

@NekoAsakura

Bug report

Bug description:

_CHECK_ATTR_CLASS calls sym_set_const(owner, type) without installing a type watcher. If the type mutates, the executor isn't invalidated.

}
else {
sym_set_const(owner, type);
}
}

Should install a watcher like _GUARD_TYPE_VERSION does:
if (sym_set_type_version(owner, type_version)) {
PyType_Watch(TYPE_WATCHER_ID, (PyObject *)type);
_Py_BloomFilter_Add(dependencies, type);
}
}

Found by @Fidget-Spinner in #148394 (comment)

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-JITtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions