Skip to content

Commit 066fd2b

Browse files
Revert SList dead code elimination change
SList is used as a structural wrapper by transform_program, which pattern-matches on SList [SList ...; SList ...; ...] to unpack program blocks. Converting empty SList to Skip breaks this invariant and causes an ICE during program transformation. The asymmetry with Block/Profile is intentional.
1 parent 1bdf1e0 commit 066fd2b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/analysis_and_optimization/Optimize.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ let dead_code_elimination (mir : Program.Typed.t) =
805805
if List.length l' = 0 then Skip else Block l'
806806
| SList l ->
807807
let l' = List.filter ~f:(fun x -> x.pattern <> Skip) l in
808-
if List.is_empty l' then Skip else SList l' in
808+
SList l' in
809809
let dead_code_elim_stmt =
810810
map_rec_stmt_loc_num flowgraph_to_mir dead_code_elim_stmt_base in
811811
dead_code_elim_stmt (Map.find_exn flowgraph_to_mir 1) in

0 commit comments

Comments
 (0)