mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	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
			
			
This commit is contained in:
		
							parent
							
								
									f8ba9fb2ce
								
							
						
					
					
						commit
						c8fd4b12e3
					
				
					 3 changed files with 7 additions and 4 deletions
				
			
		|  | @ -469,7 +469,7 @@ _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction trace[], siz | ||||||
|     // Loop once to find the total compiled size:
 |     // Loop once to find the total compiled size:
 | ||||||
|     size_t code_size = 0; |     size_t code_size = 0; | ||||||
|     size_t data_size = 0; |     size_t data_size = 0; | ||||||
|     jit_state state = {}; |     jit_state state = {0}; | ||||||
|     group = &trampoline; |     group = &trampoline; | ||||||
|     code_size += group->code_size; |     code_size += group->code_size; | ||||||
|     data_size += group->data_size; |     data_size += group->data_size; | ||||||
|  |  | ||||||
|  | @ -339,7 +339,7 @@ def _get_trampoline_mask(self) -> str: | ||||||
|             word = bitmask & ((1 << 32) - 1) |             word = bitmask & ((1 << 32) - 1) | ||||||
|             trampoline_mask.append(f"{word:#04x}") |             trampoline_mask.append(f"{word:#04x}") | ||||||
|             bitmask >>= 32 |             bitmask >>= 32 | ||||||
|         return "{" + ", ".join(trampoline_mask) + "}" |         return "{" + (", ".join(trampoline_mask) or "0") + "}" | ||||||
| 
 | 
 | ||||||
|     def as_c(self, opname: str) -> str: |     def as_c(self, opname: str) -> str: | ||||||
|         """Dump this hole as a StencilGroup initializer.""" |         """Dump this hole as a StencilGroup initializer.""" | ||||||
|  |  | ||||||
|  | @ -32,8 +32,11 @@ def _dump_footer( | ||||||
|     yield "};" |     yield "};" | ||||||
|     yield "" |     yield "" | ||||||
|     yield f"static const void * const symbols_map[{max(len(symbols), 1)}] = {{" |     yield f"static const void * const symbols_map[{max(len(symbols), 1)}] = {{" | ||||||
|     for symbol, ordinal in symbols.items(): |     if symbols: | ||||||
|         yield f"    [{ordinal}] = &{symbol}," |         for symbol, ordinal in symbols.items(): | ||||||
|  |             yield f"    [{ordinal}] = &{symbol}," | ||||||
|  |     else: | ||||||
|  |         yield "    0" | ||||||
|     yield "};" |     yield "};" | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Michael Droettboom
						Michael Droettboom