Skip to content

Commit a63b610

Browse files
committed
Remove some nonsense code generated by uninit
1 parent eb418b1 commit a63b610

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

mypyc/transform/uninit.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,19 @@ def split_blocks_at_uninits(
6969
and not (isinstance(op, Branch) and op.op == Branch.IS_ERROR)
7070
and not isinstance(op, LoadAddress)
7171
):
72-
new_block, error_block = BasicBlock(), BasicBlock()
73-
new_block.error_handler = error_block.error_handler = cur_block.error_handler
74-
new_blocks += [error_block, new_block]
75-
7672
if src not in init_registers_set:
7773
init_registers.append(src)
7874
init_registers_set.add(src)
7975

76+
# XXX: if src.name is empty, it should be a
77+
# temp... and it should be OK??
78+
if not src.name:
79+
continue
80+
81+
new_block, error_block = BasicBlock(), BasicBlock()
82+
new_block.error_handler = error_block.error_handler = cur_block.error_handler
83+
new_blocks += [error_block, new_block]
84+
8085
if not src.type.error_overlap:
8186
cur_block.ops.append(
8287
Branch(

0 commit comments

Comments
 (0)