From f274c05a20b85398afb5371d94ed4ed310f32c80 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Sat, 29 Jul 2023 21:59:30 -0700 Subject: [PATCH 1/3] Fix off-by-one error --- Python/optimizer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Python/optimizer.c b/Python/optimizer.c index 09120c33d130ca..238ab02d09faa7 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -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)) { From 2c2b84702ae92ce1e9576316d5b2bf4def62ec2d Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Sat, 29 Jul 2023 22:01:57 -0700 Subject: [PATCH 2/3] blurb add --- .../2023-07-29-22-01-30.gh-issue-104584.tINuoA.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-07-29-22-01-30.gh-issue-104584.tINuoA.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-07-29-22-01-30.gh-issue-104584.tINuoA.rst b/Misc/NEWS.d/next/Core and Builtins/2023-07-29-22-01-30.gh-issue-104584.tINuoA.rst new file mode 100644 index 00000000000000..1bf0c90523684d --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-07-29-22-01-30.gh-issue-104584.tINuoA.rst @@ -0,0 +1,2 @@ +Fix an issue which caused incorrect inline values to be used when running +with :envvar:`PYTHONUOPS` or :option:`-X uops <-X>` enabled. From e1893696d9619da6de0c30417ee936b92a4c3c4f Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Sat, 29 Jul 2023 22:08:02 -0700 Subject: [PATCH 3/3] fixup --- .../2023-07-29-22-01-30.gh-issue-104584.tINuoA.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-07-29-22-01-30.gh-issue-104584.tINuoA.rst b/Misc/NEWS.d/next/Core and Builtins/2023-07-29-22-01-30.gh-issue-104584.tINuoA.rst index 1bf0c90523684d..059524831597b7 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2023-07-29-22-01-30.gh-issue-104584.tINuoA.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2023-07-29-22-01-30.gh-issue-104584.tINuoA.rst @@ -1,2 +1,2 @@ -Fix an issue which caused incorrect inline values to be used when running +Fix an issue which caused incorrect inline caches to be read when running with :envvar:`PYTHONUOPS` or :option:`-X uops <-X>` enabled.