Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/bytecomp/switch.ml b/bytecomp/switch.ml
- index 90dfde2..24e6d1c 100644
- --- a/bytecomp/switch.ml
- +++ b/bytecomp/switch.ml
- @@ -722,7 +722,7 @@ let comp_clusters ({cases=cases ; actions=actions} as s) =
- let make_switch {cases=cases ; actions=actions} i j =
- let ll,_,_ = cases.(i)
- and _,hh,_ = cases.(j) in
- - let tbl = Array.make (hh-ll+1) 0
- + let tbl = Array.make (hh-ll+1) (-1)
- and t = Hashtbl.create 17
- and index = ref 0 in
- let get_index act =
- @@ -742,7 +742,11 @@ let make_switch {cases=cases ; actions=actions} i j =
- tbl.(kk) <- index
- done
- done ;
- - let acts = Array.make !index actions.(0) in
- + let dummy = lazy (incr index; !index - 1) in
- + for i = 0 to Array.length tbl - 1 do
- + if tbl.(i) < 0 then tbl.(i) <- Lazy.force dummy
- + done;
- + let acts = Array.make !index (Arg.make_const 42) in
- Hashtbl.iter
- (fun act i -> acts.(i) <- actions.(act))
- t ;
Add Comment
Please, Sign In to add comment