From: Brandt Bucher Date: Mon, 31 Jul 2023 21:16:57 +0000 (-0700) Subject: GH-104584: Fix incorrect uoperands (GH-107513) X-Git-Tag: v3.13.0a1~1121 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5e584eb704d656c9a6a648dadda63237706287db;p=thirdparty%2FPython%2Fcpython.git GH-104584: Fix incorrect uoperands (GH-107513) --- 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 000000000000..059524831597 --- /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 caches to be read when running +with :envvar:`PYTHONUOPS` or :option:`-X uops <-X>` enabled. diff --git a/Python/optimizer.c b/Python/optimizer.c index 09120c33d130..238ab02d09fa 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -579,7 +579,8 @@ pop_jump_if_bool: 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)) {