-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
COMPARE_OP is "documented" to use oparg >> 5 to choose which comparison operation to execute. However in COMPARE_OP_INT and other specializations oparg without any shifting is used.
I'm not entirely sure if this is a bug because:
- i hit while writing a "convert X to python bytecode" tool and my python bytecode knowledge is not that good
- by checking empirically instruction that are emitted by CPython are encoded to work correctly with this quirk (i.e. COMPARE_OP is generally emitted with an argument that has one of the 4 low bits set)
I'm probably missing something, but I'm still reporting it just in case.
CPython versions tested on:
3.14
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error