Skip to content

Commit 7734b6d

Browse files
DinoVmeta-codesync[bot]
authored andcommitted
Make EAGER_IMPORT_NAME use an unused opcode slot
Summary: This makes the `EAGER_IMPORT_NAME` opcode use an used slot on 3.14's existing opcode space. This stops the opcodes from shuffling around vs stock 3.14. Reviewed By: itamaro Differential Revision: D84212086 fbshipit-source-id: dcc240254fe1c9b821e11b01ea33b9ec45ecb6d0
1 parent 5f37edd commit 7734b6d

File tree

7 files changed

+122
-120
lines changed

7 files changed

+122
-120
lines changed

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ Known values:
281281
Python 3.14rc2 3626 (Fix missing exception handlers in logical expression)
282282
Python 3.14rc3 3627 (Fix miscompilation of some module-level annotations)
283283
[META] Python 3.14rc3+meta 3628 (Lazy Imports introduces new opcode and compiler changes around import statement compilation)
284+
[META] Python 3.14+meta 3629 Lazy imports EAGER_IMPORT_NAME doesn't reshuffle opcode numbers
284285
285286
Python 3.15 will start with 3650
286287
@@ -293,7 +294,7 @@ PC/launcher.c must also be updated.
293294
294295
*/
295296

296-
#define PYC_MAGIC_NUMBER 3628
297+
#define PYC_MAGIC_NUMBER 3629
297298
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
298299
(little-endian) and then appending b'\r\n'. */
299300
#define PYC_MAGIC_NUMBER_TOKEN \

Include/opcode_ids.h

Lines changed: 54 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/_opcode_metadata.py

Lines changed: 54 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/test/test_importlib/test_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ def test_magic_number(self):
635635
# stakeholders such as OS package maintainers must be notified
636636
# in advance. Such exceptional releases will then require an
637637
# adjustment to this test case.
638-
EXPECTED_MAGIC_NUMBER = 3628
638+
EXPECTED_MAGIC_NUMBER = 3629
639639
actual = int.from_bytes(importlib.util.MAGIC_NUMBER[:2], 'little')
640640

641641
msg = (

Programs/test_frozenmain.h

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/opcode_targets.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/cases_generator/analyzer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,7 @@ def assign_opcodes(
10381038
if "EXTENDED_OPCODE" in instructions:
10391039
instmap["EXTENDED_OPCODE"] = 126
10401040

1041+
instmap["EAGER_IMPORT_NAME"] = 121
10411042
instmap["INSTRUMENTED_LINE"] = 254
10421043
instmap["ENTER_EXECUTOR"] = 255
10431044

0 commit comments

Comments
 (0)