2
0
Эх сурвалжийг харах

properly compare types in DCE (fixed issue #1479)

Simon Krajewski 12 жил өмнө
parent
commit
2e24ad1c36
1 өөрчлөгдсөн 3 нэмэгдсэн , 2 устгасан
  1. 3 2
      dce.ml

+ 3 - 2
dce.ml

@@ -186,10 +186,11 @@ let opt f e = match e with None -> () | Some e -> f e
 
 let rec to_string dce t =
 	let push t =
-		dce.t_stack <- (follow t) :: dce.t_stack;
+		dce.t_stack <- t :: dce.t_stack;
 		fun () -> dce.t_stack <- List.tl dce.t_stack
 	in
-	if not (List.mem (follow t) dce.t_stack) then match follow t with
+	let t = follow t in
+	if not (List.exists (fun t2 -> Type.fast_eq t t2) dce.t_stack) then match follow t with
 	| TInst(c,pl) as t ->
 		let pop = push t in
 		field dce c "toString" false;