aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cflow.ml
diff options
context:
space:
mode:
Diffstat (limited to 'cparser/Cflow.ml')
-rw-r--r--cparser/Cflow.ml5
1 files changed, 3 insertions, 2 deletions
diff --git a/cparser/Cflow.ml b/cparser/Cflow.ml
index 7de5cf59..f5408c15 100644
--- a/cparser/Cflow.ml
+++ b/cparser/Cflow.ml
@@ -14,7 +14,8 @@
(* *********************************************************************)
(* A simple control flow analysis for C statements.
- Main purpose: emit warnings for _Noreturn functions. *)
+ Main purpose: emit warnings for non-void functions that fall through,
+ and for _Noreturn functions that can return. *)
open C
open Cutil
@@ -148,7 +149,7 @@ let case (s: flow) : flow = fun i ->
s { i with inormal = i.inormal || i.iswitch }
let switch (s: flow) : flow = fun i ->
- s { i with inormal = false; iswitch = true }
+ s { i with inormal = false; iswitch = i.inormal }
(* This is the flow for an infinite loop with body [s].
There is no fallthrough exit, but all other exits from [s] are preserved. *)