File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 55* Compiler: no longer rely on IIFE for scoping variable inside loops
66* Lib: add ellipse to canvasRenderingContext2D (@FayCarsons , #1555 )
77
8+ ## Bug fixes
9+ * Compiler: fix global dead code elimination in a toplevel context
10+
811# 5.6.0 (2024-01-02) - Lille
912
1013## Features/Changes
Original file line number Diff line number Diff line change @@ -246,6 +246,15 @@ let liveness prog pure_funs (global_info : Global_flow.info) =
246246 | Stop | Branch _ | Poptrap _ | Pushtrap _ -> ()
247247 in
248248 Addr.Map. iter (fun _ block -> live_block block) prog.blocks;
249+ Code. traverse
250+ { Code. fold = Code. fold_children }
251+ (fun pc () ->
252+ match Addr.Map. find pc prog.blocks with
253+ | { branch = Return x , _ ; _ } -> add_top x
254+ | _ -> () )
255+ prog.start
256+ prog.blocks
257+ () ;
249258 live_vars
250259
251260(* Returns the set of variables given a table of variables. *)
Original file line number Diff line number Diff line change 11hello
2+ - : int = 2
23Line 4, characters 2-4:
34Error: Syntax error
45Line 5, characters 0-16:
You can’t perform that action at this time.
0 commit comments