Skip to content

Commit

Permalink
Fix miscompilation in comballoc for local allocations (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpw25 authored and mshinwell committed Sep 14, 2022
1 parent 9beb63a commit 555728f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions backend/comballoc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ let rec combine i allocstate =
let newnext = combine_restart i.next in
(instr_cons_debug i.desc i.arg i.res i.dbg newnext,
allocstate)
| Iop(Ibeginregion|Iendregion) -> begin
match allocstate with
| Pending_alloc { mode = Alloc_local; _ } ->
let newnext = combine_restart i.next in
(instr_cons_debug i.desc i.arg i.res i.dbg newnext, allocstate)
| No_alloc | Pending_alloc { mode = Alloc_heap; _ } ->
let newnext, s' = combine i.next allocstate in
(instr_cons_debug i.desc i.arg i.res i.dbg newnext, s')
end
| Iop _ ->
let (newnext, s') = combine i.next allocstate in
(instr_cons_debug i.desc i.arg i.res i.dbg newnext, s')
Expand Down

0 comments on commit 555728f

Please sign in to comment.