Skip to content

Commit

Permalink
GH-104584: Fix incorrect uoperands (GH-107513)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher authored Jul 31, 2023
1 parent de51ded commit 5e584eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix an issue which caused incorrect inline caches to be read when running
with :envvar:`PYTHONUOPS` or :option:`-X uops <-X>` enabled.
3 changes: 2 additions & 1 deletion Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,8 @@ translate_bytecode_to_trace(
for (int i = 0; i < nuops; i++) {
oparg = orig_oparg;
uint64_t operand = 0;
int offset = expansion->uops[i].offset;
// Add one to account for the actual opcode/oparg pair:
int offset = expansion->uops[i].offset + 1;
switch (expansion->uops[i].size) {
case OPARG_FULL:
if (extras && OPCODE_HAS_JUMP(opcode)) {
Expand Down

0 comments on commit 5e584eb

Please sign in to comment.