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

add pseudo-goto out of "infinite" loops (closes #4747)

Simon Krajewski 9 жил өмнө
parent
commit
5924777494
1 өөрчлөгдсөн 3 нэмэгдсэн , 1 устгасан
  1. 3 1
      analyzer.ml

+ 3 - 1
analyzer.ml

@@ -1222,7 +1222,9 @@ module TexprTransformer = struct
 				let bb_breaks = close() in
 				scope();
 				let dom = match bb_breaks with
-					| [] -> g.g_unreachable
+					| [] ->
+						add_cfg_edge g bb_loop_body_next bb_exit CFGGoto;
+						g.g_unreachable
 					| [bb_break] -> bb_break
 					| _ -> bb_loop_body (* TODO: this is not accurate for while(true) loops *)
 				in