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
e13e0ae6
Commit
e13e0ae6
authored
4 years ago
by
David Bühler
Committed by
Valentin Perrelle
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Uses constants in bitwise AND operations as widening thresholds.
parent
0e3ec3de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/value/utils/widen.ml
+18
-14
18 additions, 14 deletions
src/plugins/value/utils/widen.ml
with
18 additions
and
14 deletions
src/plugins/value/utils/widen.ml
+
18
−
14
View file @
e13e0ae6
...
...
@@ -172,20 +172,24 @@ class pragma_widen_visitor init_widen_hints init_enclosing_loops = object(self)
List
.
iter
aux_loop
enclosing_loops
;
Cil
.
DoChildren
end
|
Instr
(
Set
((
Var
vi
,
_
)
,
exp
,
_
)
)
->
begin
match
exp
.
enode
with
|
BinOp
(
Mod
,
_
,
modu
,
_typ
)
|
CastE
(
_typ
,
{
enode
=
BinOp
(
Mod
,
_
,
modu
,
_
)})
->
begin
match
Cil
.
constFoldToInt
modu
with
|
None
->
()
|
Some
i
->
let
base
=
Base
.
of_varinfo
vi
in
let
threshold
=
Ival
.
Widen_Hints
.
singleton
(
Integer
.
pred
i
)
in
self
#
add_int_thresholds
~
base
threshold
;
end
|
_
->
()
end
;
|
Instr
(
Set
((
Var
vi
,
_
)
,
exp
,
_
)
)
->
let
rec
find_candidates
expr
=
match
expr
.
enode
with
|
BinOp
(
Mod
,
_
,
modu
,
_typ
)
->
[
modu
]
|
BinOp
(
LAnd
,
e1
,
e2
,
_typ
)
->
[
e1
;
e2
]
|
CastE
(
_
,
expr
)
|
Info
(
expr
,
_
)
->
find_candidates
expr
|
_
->
[]
in
let
process
expr
=
match
Cil
.
constFoldToInt
expr
with
|
None
->
()
|
Some
i
->
let
base
=
Base
.
of_varinfo
vi
in
let
threshold
=
Ival
.
Widen_Hints
.
singleton
(
Integer
.
pred
i
)
in
self
#
add_int_thresholds
~
base
threshold
in
List
.
iter
process
(
find_candidates
exp
);
Cil
.
DoChildren
|
_
->
Cil
.
DoChildren
...
...
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