GH-142050: Jit stencils on Windows contain debug data (#142052)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
This commit is contained in:
Chris Eibl 2025-12-03 23:08:51 +01:00 committed by GitHub
parent c0c65141b3
commit 618dc36714
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 0 deletions

View file

@ -0,0 +1 @@
Fixed a bug where JIT stencils produced on Windows contained debug data. Patch by Chris Eibl.

View 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]]

View 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"]