Skip to content

Commit bfe5eb9

Browse files
address review
1 parent ddf85c6 commit bfe5eb9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Tools/jit/_optimizers.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,13 @@ def __post_init__(self) -> None:
223223
block.link = block = _Block()
224224
inst = self._parse_instruction(line)
225225
block.instructions.append(inst)
226-
if inst.is_branch() or inst.kind == InstructionKind.CALL:
227-
# A block ending in a branch/call has a target and fallthrough:
226+
if inst.is_branch():
227+
# A block ending in a branch has a target and fallthrough:
228+
assert inst.target is not None
229+
block.target = self._lookup_label(inst.target)
230+
assert block.fallthrough
231+
elif inst.kind == InstructionKind.CALL:
232+
# A block ending in a call has a target and return point after call:
228233
assert inst.target is not None
229234
block.target = self._lookup_label(inst.target)
230235
assert block.fallthrough
@@ -262,7 +267,7 @@ def _parse_instruction(self, line: str) -> Instruction:
262267
elif match := self._re_call.match(line):
263268
target = match["target"]
264269
name = line[: -len(target)].strip()
265-
kind = InstructionKind.JUMP
270+
kind = InstructionKind.CALL
266271
elif match := self._re_return.match(line):
267272
name = line
268273
kind = InstructionKind.RETURN

0 commit comments

Comments
 (0)