Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6490a71

Browse files
committed
Fix M1 builds
1 parent f142c2f commit 6490a71

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Tools/jit/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ def dump(stencils: dict[str, StencilGroup]) -> typing.Generator[str, None, None]
888888
for line in stencil.body.disassembly:
889889
yield f"// {line}"
890890
body = ", ".join(f"0x{byte:02x}" for byte in stencil.body.body)
891-
yield f"static const unsigned char {opname}_body_bytes[{len(stencil.body.body)}] = {{{body}}};"
891+
yield f"static const unsigned char {opname}_body_bytes[{len(stencil.body.body) + 1}] = {{{body}}};"
892892
if stencil.body.holes:
893893
yield f"static const Hole {opname}_body_holes[{len(stencil.body.holes) + 1}] = {{"
894894
for hole in sorted(stencil.body.holes, key=lambda hole: hole.offset):
@@ -924,7 +924,7 @@ def dump(stencils: dict[str, StencilGroup]) -> typing.Generator[str, None, None]
924924
yield f"static const Hole {opname}_data_holes[1];"
925925
yield f""
926926
yield f"#define INIT_STENCIL(STENCIL) {{ \\"
927-
yield f" .nbytes = Py_ARRAY_LENGTH(STENCIL##_bytes), \\"
927+
yield f" .nbytes = Py_ARRAY_LENGTH(STENCIL##_bytes) - 1, \\"
928928
yield f" .bytes = STENCIL##_bytes, \\"
929929
yield f" .nholes = Py_ARRAY_LENGTH(STENCIL##_holes) - 1, \\"
930930
yield f" .holes = STENCIL##_holes, \\"

0 commit comments

Comments
 (0)