GH-115869: Make jit_stencils.h reproducible (GH-127166)

This commit is contained in:
Brandt Bucher 2024-11-24 14:42:50 -08:00 committed by GitHub
parent 307c633586
commit 17c16aea66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 18 additions and 9 deletions

View file

@ -202,7 +202,8 @@ class Stencil:
"""Pad the stencil to the given alignment."""
offset = len(self.body)
padding = -offset % alignment
self.disassembly.append(f"{offset:x}: {' '.join(['00'] * padding)}")
if padding:
self.disassembly.append(f"{offset:x}: {' '.join(['00'] * padding)}")
self.body.extend([0] * padding)
def remove_jump(self, *, alignment: int = 1) -> None: