File tree 3 files changed +13
-0
lines changed
3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 5
5
* Compiler: no longer rely on IIFE for scoping variable inside loops
6
6
* Lib: add ellipse to canvasRenderingContext2D (@FayCarsons , #1555 )
7
7
8
+ ## Bug fixes
9
+ * Compiler: fix global dead code elimination in a toplevel context
10
+
8
11
# 5.6.0 (2024-01-02) - Lille
9
12
10
13
## 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) =
246
246
| Stop | Branch _ | Poptrap _ | Pushtrap _ -> ()
247
247
in
248
248
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
+ () ;
249
258
live_vars
250
259
251
260
(* Returns the set of variables given a table of variables. *)
Original file line number Diff line number Diff line change 1
1
hello
2
+ - : int = 2
2
3
Line 4, characters 2-4:
3
4
Error: Syntax error
4
5
Line 5, characters 0-16:
You can’t perform that action at this time.
0 commit comments