Skip to content

Commit

Permalink
Merge pull request sampsyo#81 from kq-li/master
Browse files Browse the repository at this point in the history
Fix basic block construction bug
  • Loading branch information
sampsyo authored Sep 21, 2020
2 parents 083326b + 1d59cfa commit 9fe23d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bril-ocaml/lib/func.ml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ let process_instrs instrs =
~init:(block_name 0, [], [])
~f:(fun (name, block, blocks) (instr : Instr.t) ->
match instr with
| Label name -> (name, block, blocks)
| Label label ->
if List.is_empty block then (label, [], blocks)
else (label, [], (name, List.rev block) :: blocks)
| Jmp _
| Br _
| Ret _ ->
Expand Down

0 comments on commit 9fe23d2

Please sign in to comment.