Skip to content

Commit 5e584eb

Browse files
authored
GH-104584: Fix incorrect uoperands (GH-107513)
1 parent de51ded commit 5e584eb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix an issue which caused incorrect inline caches to be read when running
2+
with :envvar:`PYTHONUOPS` or :option:`-X uops <-X>` enabled.

Python/optimizer.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,8 @@ translate_bytecode_to_trace(
579579
for (int i = 0; i < nuops; i++) {
580580
oparg = orig_oparg;
581581
uint64_t operand = 0;
582-
int offset = expansion->uops[i].offset;
582+
// Add one to account for the actual opcode/oparg pair:
583+
int offset = expansion->uops[i].offset + 1;
583584
switch (expansion->uops[i].size) {
584585
case OPARG_FULL:
585586
if (extras && OPCODE_HAS_JUMP(opcode)) {

0 commit comments

Comments
 (0)