Skip to content
Snippets Groups Projects
Commit 4a497bc2 authored by Allan Blanchard's avatar Allan Blanchard Committed by Virgile Prevosto
Browse files

[ghost] changes an error kind

parent fc04d679
No related branches found
No related tags found
No related merge requests found
...@@ -163,9 +163,9 @@ and cfgStmt env (s: stmt) next break cont = ...@@ -163,9 +163,9 @@ and cfgStmt env (s: stmt) next break cont =
if s.sid = -1 then s.sid <- Cil_const.Sid.next (); if s.sid = -1 then s.sid <- Cil_const.Sid.next ();
nodeList := s :: !nodeList; nodeList := s :: !nodeList;
if s.succs <> [] then if s.succs <> [] then
Kernel.fatal Kernel.fatal
"CFG must be cleared before being computed! Stmt %d '%a' \ "CFG must be cleared before being computed! Stmt %d '%a' \
has %d successors" has %d successors"
s.sid Cil_printer.pp_stmt s (List.length s.succs); s.sid Cil_printer.pp_stmt s (List.length s.succs);
let addSucc (n: stmt) = let addSucc (n: stmt) =
s.succs <- n::s.succs; s.succs <- n::s.succs;
...@@ -228,8 +228,7 @@ and cfgStmt env (s: stmt) next break cont = ...@@ -228,8 +228,7 @@ and cfgStmt env (s: stmt) next break cont =
() ()
| Return _ | Throw _ -> () | Return _ | Throw _ -> ()
| Goto (p,_) when not s.ghost && !p.ghost -> | Goto (p,_) when not s.ghost && !p.ghost ->
Kernel.warning Kernel.error
~wkey:Kernel.wkey_ghost_bad_non_ghost
"%a:@ '%a' cannot see target label (ghost), removing ghost status of the label." "%a:@ '%a' cannot see target label (ghost), removing ghost status of the label."
Location.pretty (Stmt.loc s) Cil_printer.pp_stmt s ; Location.pretty (Stmt.loc s) Cil_printer.pp_stmt s ;
(!p).ghost <- false ; (!p).ghost <- false ;
...@@ -591,7 +590,7 @@ let xform_switch_block ?(keepSwitch=false) b = ...@@ -591,7 +590,7 @@ let xform_switch_block ?(keepSwitch=false) b =
(* begin replacement: *) (* begin replacement: *)
let pred = let pred =
match ce.enode with match ce.enode with
Const (CInt64 (z,_,_)) Const (CInt64 (z,_,_))
when Integer.equal z Integer.zero when Integer.equal z Integer.zero
-> ->
new_exp ~loc:ce.eloc (UnOp(LNot,e,intType)) new_exp ~loc:ce.eloc (UnOp(LNot,e,intType))
......
...@@ -132,9 +132,6 @@ let dkey_visitor = register_category "visitor" ...@@ -132,9 +132,6 @@ let dkey_visitor = register_category "visitor"
let wkey_annot_error = register_warn_category "annot-error" let wkey_annot_error = register_warn_category "annot-error"
let () = set_warn_status wkey_annot_error Log.Wabort let () = set_warn_status wkey_annot_error Log.Wabort
let wkey_ghost_bad_non_ghost = register_warn_category "ghost:bad-non-ghost"
let () = set_warn_status wkey_ghost_bad_non_ghost Log.Werror
let wkey_ghost_bad_use = register_warn_category "ghost:bad-use" let wkey_ghost_bad_use = register_warn_category "ghost:bad-use"
let () = set_warn_status wkey_ghost_bad_use Log.Werror let () = set_warn_status wkey_ghost_bad_use Log.Werror
......
...@@ -130,9 +130,6 @@ val dkey_visitor: category ...@@ -130,9 +130,6 @@ val dkey_visitor: category
val wkey_annot_error: warn_category val wkey_annot_error: warn_category
(** error in annotation. If only a warning, annotation will just be ignored. *) (** error in annotation. If only a warning, annotation will just be ignored. *)
val wkey_ghost_bad_non_ghost: warn_category
(** error in non ghost code related to the use of ghost elements *)
val wkey_ghost_bad_use: warn_category val wkey_ghost_bad_use: warn_category
(** error in ghost code *) (** error in ghost code *)
......
[kernel] Parsing tests/cil/ghost_cfg.c (with preprocessing) [kernel] Parsing tests/cil/ghost_cfg.c (with preprocessing)
[kernel:ghost:bad-non-ghost] Warning: [kernel] User Error: tests/cil/ghost_cfg.c:101:
tests/cil/ghost_cfg.c:101:
'goto X;' cannot see target label (ghost), removing ghost status of the label. 'goto X;' cannot see target label (ghost), removing ghost status of the label.
[kernel] Warning: warning ghost:bad-non-ghost treated as deferred error. See above messages for more information. [kernel] User Error: Deferred error message was emitted during execution. See above messages for more information.
[kernel] Frama-C aborted: invalid user input. [kernel] Frama-C aborted: invalid user input.
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