فهرست منبع

[analyzer] do not try to reconstruct `do` loops in weird ways (closes #3844)

Simon Krajewski 10 سال پیش
والد
کامیت
605bfe78fc
2فایلهای تغییر یافته به همراه14 افزوده شده و 2 حذف شده
  1. 4 2
      analyzer.ml
  2. 10 0
      tests/unit/src/unit/issues/Issue3844.hx

+ 4 - 2
analyzer.ml

@@ -453,13 +453,15 @@ module Simplifier = struct
 									let e1 = extract_cond e1 in
 									e1,{e2 with eexpr = TBlock el},NormalWhile
 								| _ ->
-									begin match List.rev el with
+									e1,e2,flag
+									(* issue 3844 *)
+(* 									begin match List.rev el with
 										| {eexpr = TMeta((Meta.Custom ":whileCond",_,_),e1)} :: el ->
 											let e1 = extract_cond e1 in
 											e1,{e2 with eexpr = TBlock (List.rev el)},DoWhile
 										| _ ->
 											e1,e2,flag
-									end
+									end *)
 							end
 						| _ ->
 							e1,e2,flag

+ 10 - 0
tests/unit/src/unit/issues/Issue3844.hx

@@ -0,0 +1,10 @@
+package unit.issues;
+
+private typedef A = {f: A}
+
+class Issue3844 extends Test {
+	function test() {
+		var n:A = {f: null};
+		do n = n.f while (n!=null && (n!=null || n!=null));
+	}
+}