]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-142050: Jit stencils on Windows contain debug data (#142052)
authorChris Eibl <138194463+chris-eibl@users.noreply.github.com>
Wed, 3 Dec 2025 22:08:51 +0000 (23:08 +0100)
committerGitHub <noreply@github.com>
Wed, 3 Dec 2025 22:08:51 +0000 (22:08 +0000)
Co-authored-by: Savannah Ostrowski <savannah@python.org>
Misc/NEWS.d/next/Build/2025-11-28-21-43-07.gh-issue-142050.PFi4tv.rst [new file with mode: 0644]
Tools/jit/_schema.py
Tools/jit/_targets.py

diff --git a/Misc/NEWS.d/next/Build/2025-11-28-21-43-07.gh-issue-142050.PFi4tv.rst b/Misc/NEWS.d/next/Build/2025-11-28-21-43-07.gh-issue-142050.PFi4tv.rst
new file mode 100644 (file)
index 0000000..8917d5d
--- /dev/null
@@ -0,0 +1 @@
+Fixed a bug where JIT stencils produced on Windows contained debug data. Patch by Chris Eibl.
index c47e9af924a20ee16f693546407336e319413081..4e86abe604972eb726d0fdc229136a7dd6826a0d 100644 (file)
@@ -89,6 +89,7 @@ class COFFSection(typing.TypedDict):
     Characteristics: dict[
         typing.Literal["Flags"], list[dict[typing.Literal["Name"], str]]
     ]
+    Name: dict[typing.Literal["Value"], str]
     Number: int
     RawDataSize: int
     Relocations: list[dict[typing.Literal["Relocation"], COFFRelocation]]
index a76d8ff2792602797f4dab86f99569e1ed41b1ed..4c188d74a68602bffd634c400fac6dfe34a2c305 100644 (file)
@@ -267,6 +267,10 @@ class _COFF(
     def _handle_section(
         self, section: _schema.COFFSection, group: _stencils.StencilGroup
     ) -> None:
+        name = section["Name"]["Value"]
+        if name == ".debug$S":
+            # skip debug sections
+            return
         flags = {flag["Name"] for flag in section["Characteristics"]["Flags"]}
         if "SectionData" in section:
             section_data_bytes = section["SectionData"]["Bytes"]