-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
This assert https://github.com/python/cpython/blob/main/Include/internal/pycore_stackref.h#L406 contains a left shift of a potentially negative value which is undefined behavior. The non-assert line does a uintptr_t cast to avoid the undefined behavior. Replicate that in the assert and then cast the final value back to intptr_t.
This can show up when running with various sanitizers enabled.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error