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

[wp] catch dimension errors

parent 15d7cd62
No related branches found
No related tags found
No related merge requests found
...@@ -61,9 +61,10 @@ PLUGIN_NAME:=Wp ...@@ -61,9 +61,10 @@ PLUGIN_NAME:=Wp
PLUGIN_CMO:= \ PLUGIN_CMO:= \
rformat wprop \ rformat wprop \
wp_parameters wp_error \ wp_parameters wp_error \
dyncall ctypes clabels \
Why3Provers \ Why3Provers \
Context Warning AssignsCompleteness MemoryContext wpContext \ Context Warning \
dyncall ctypes clabels \
AssignsCompleteness MemoryContext wpContext \
LogicUsage RefUsage \ LogicUsage RefUsage \
Layout Region \ Layout Region \
RegionAnnot RegionAccess RegionDump RegionAnalysis \ RegionAnnot RegionAccess RegionDump RegionAnalysis \
......
...@@ -237,8 +237,13 @@ let char c = Integer.to_int64 (Cil.charConstToInt c) ...@@ -237,8 +237,13 @@ let char c = Integer.to_int64 (Cil.charConstToInt c)
let constant e = let constant e =
match (Cil.constFold true e).enode with match (Cil.constFold true e).enode with
| Const(CInt64(k,_,_)) -> Integer.to_int64 k | Const(CInt64(k,_,_)) ->
| _ -> WpLog.fatal "Non-constant expression (%a)" Printer.pp_exp e begin
try Integer.to_int64 k
with Z.Overflow ->
Warning.error "Array size too large (%a)" (Integer.pretty ~hexa:true) k
end
| _ -> Warning.error "Non-constant expression (%a)" Printer.pp_exp e
let get_int e = let get_int e =
match (Cil.constFold true e).enode with match (Cil.constFold true e).enode with
......
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