Skip to content

Commit a046845

Browse files
authored
Fix miscompilation in comballoc for local allocations (#829)
1 parent c346dcc commit a046845

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

backend/comballoc.ml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ let rec combine i allocstate =
7575
let newnext = combine_restart i.next in
7676
(instr_cons_debug i.desc i.arg i.res i.dbg newnext,
7777
allocstate)
78+
| Iop(Ibeginregion|Iendregion) -> begin
79+
match allocstate with
80+
| Pending_alloc { mode = Alloc_local; _ } ->
81+
let newnext = combine_restart i.next in
82+
(instr_cons_debug i.desc i.arg i.res i.dbg newnext, allocstate)
83+
| No_alloc | Pending_alloc { mode = Alloc_heap; _ } ->
84+
let newnext, s' = combine i.next allocstate in
85+
(instr_cons_debug i.desc i.arg i.res i.dbg newnext, s')
86+
end
7887
| Iop _ ->
7988
let (newnext, s') = combine i.next allocstate in
8089
(instr_cons_debug i.desc i.arg i.res i.dbg newnext, s')

0 commit comments

Comments
 (0)