File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments