浏览代码

properly compare types in DCE (fixed issue #1479)

Simon Krajewski 12 年之前
父节点
当前提交
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;