Skip to content
Snippets Groups Projects
Commit 16031ca0 authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[rte] security belt on current-stmt

parent 90f5dc58
No related branches found
No related tags found
No related merge requests found
......@@ -108,8 +108,14 @@ class annot_visitor kf flags on_alarm = object (self)
method private generate_assertion: 'a. 'a Rte.alarm_gen -> 'a -> unit =
fun fgen ->
let stmt = Extlib.the (self#current_stmt) in
let on_alarm ~invalid a = on_alarm stmt ~invalid a in
let curr_stmt = self#current_stmt in
let on_alarm ~invalid a =
match curr_stmt with
| None -> Options.warning ~current:true
"Alarm generated outside any statement:@ %a"
Alarms.pretty a
| Some stmt -> on_alarm stmt ~invalid a
in
fgen ~remove_trivial:flags.Flags.remove_trivial ~on_alarm
(* Do not visit variable declarations, as no alarm should be emitted here,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment