8000 gh-125207: Fix MSVC 1935 build with JIT (#125209) · python/cpython@c8fd4b1 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c8fd4b1

Browse files
authored
gh-125207: Fix MSVC 1935 build with JIT (#125209)
* gh-125207: Use {0} array initializers * Simplify, as suggested in PR * Revert change to explicitly specify length
1 parent f8ba9fb commit c8fd4b1

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Python/jit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction trace[], siz
469469
// Loop once to find the total compiled size:
470470
size_t code_size = 0;
471471
size_t data_size = 0;
472-
jit_state state = {};
472+
jit_state state = {0};
473473
group = &trampoline;
474474
code_size += group->code_size;
475475
data_size += group->data_size;

Tools/jit/_stencils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def _get_trampoline_mask(self) -> str:
339339
word = bitmask & ((1 << 32) - 1)
340340
trampoline_mask.append(f"{word:#04x}")
341341
bitmask >>= 32
342-
return "{" + ", ".join(trampoline_mask) + "}"
342+
return "{" + (", ".join(trampoline_mask) or "0") + "}"
343343

344344
def as_c(self, opname: str) -> str:
345345
"""Dump this hole as a StencilGroup initializer."""

Tools/jit/_writer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ def _dump_footer(
3232
yield "};"
3333
yield ""
3434
yield f"static const void * const symbols_map[{max(len(symbols), 1)}] = {{"
35-
for symbol, ordinal in symbols.items():
36-
yield f" [{ordinal}] = &{symbol},"
35+
if symbols:
36+
for symbol, ordinal in symbols.items():
37+
yield f" [{ordinal}] = &{symbol},"
38+
else:
39+
yield " 0"
3740
yield "};"
3841

3942

0 commit comments

Comments
 (0)
0