From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 25 Jun 2026 14:36:04 +0000 (+0200) Subject: [3.15] gh-148825: Fix build error if specialization is disabled (GH-148826) (#152206) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eaf4d7311292c67061cae117808e14216ca969df;p=thirdparty%2FPython%2Fcpython.git [3.15] gh-148825: Fix build error if specialization is disabled (GH-148826) (#152206) gh-148825: Fix build error if specialization is disabled (GH-148826) (cherry picked from commit 56ae0b8e4f78c612f7b3095cd1c936e54ee0db5f) Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-04-21-15-07-03.gh-issue-148825.AbJzmZ.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-04-21-15-07-03.gh-issue-148825.AbJzmZ.rst new file mode 100644 index 000000000000..5cf727b5d91f --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-04-21-15-07-03.gh-issue-148825.AbJzmZ.rst @@ -0,0 +1 @@ +Fix build error if specialization is disabled. diff --git a/Python/specialize.c b/Python/specialize.c index 459e69de5709..fb75ca8d58e8 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -113,7 +113,8 @@ _PyCode_Quicken(_Py_CODEUNIT *instructions, Py_ssize_t size, int enable_counters } #else for (Py_ssize_t i = 0; i < size-1; i++) { - if (instructions[i].op.code == GET_ITER) { + int opcode = instructions[i].op.code; + if (opcode == GET_ITER) { fixup_getiter(&instructions[i], flags); } i += _PyOpcode_Caches[opcode];