File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2544,8 +2544,8 @@ optimize_load_fast(cfg_builder *g)
25442544 for (basicblock * b = entryblock ; b != NULL ; b = b -> b_next ) {
25452545 max_instrs = Py_MAX (max_instrs , b -> b_iused );
25462546 }
2547- size_t instr_flags_size = max_instrs * sizeof (bool );
2548- uint8_t * instr_flags = PyMem_Calloc ( max_instrs , instr_flags_size );
2547+ size_t instr_flags_size = max_instrs * sizeof (uint8_t );
2548+ uint8_t * instr_flags = PyMem_Malloc ( instr_flags_size );
25492549 if (instr_flags == NULL ) {
25502550 PyErr_NoMemory ();
25512551 return ERROR ;
@@ -2566,7 +2566,7 @@ optimize_load_fast(cfg_builder *g)
25662566 assert (block -> b_startdepth > -1 );
25672567
25682568 // Reset per-block state.
2569- memset (instr_flags , 0 , instr_flags_size );
2569+ memset (instr_flags , 0 , block -> b_iused * sizeof ( * instr_flags ) );
25702570
25712571 // Reset the stack of refs. We don't track references on the stack
25722572 // across basic blocks, but the bytecode will expect their
You can’t perform that action at this time.
0 commit comments