Browse Source

[analyzer] only avoid propagating toplevel-null (see #5074)

Simon Krajewski 9 năm trước cách đây
mục cha
commit
f736708e7e
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      src/optimization/analyzerTexpr.ml

+ 4 - 1
src/optimization/analyzerTexpr.ml

@@ -115,10 +115,13 @@ let rec can_be_used_as_value com e =
 		| TUnop((Increment | Decrement),_,_) when not (target_handles_unops com) -> raise Exit
 		| TNew _ when com.platform = Php -> raise Exit
 		| TFunction _ -> ()
-		| TConst TNull when (match com.platform with Cs | Cpp | Java | Flash -> true | _ -> false) -> raise Exit
 		| _ -> Type.iter loop e
 	in
 	try
+		begin match com.platform,e.eexpr with
+			| (Cs | Cpp | Java | Flash),TConst TNull -> raise Exit
+			| _ -> ()
+		end;
 		loop e;
 		true
 	with Exit ->