Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
0a27ac2e
Commit
0a27ac2e
authored
4 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[wp] catch dimension errors
parent
15d7cd62
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/wp/Makefile.in
+3
-2
3 additions, 2 deletions
src/plugins/wp/Makefile.in
src/plugins/wp/ctypes.ml
+7
-2
7 additions, 2 deletions
src/plugins/wp/ctypes.ml
with
10 additions
and
4 deletions
src/plugins/wp/Makefile.in
+
3
−
2
View file @
0a27ac2e
...
@@ -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
\
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/ctypes.ml
+
7
−
2
View file @
0a27ac2e
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment