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
8a33fdcb
Commit
8a33fdcb
authored
3 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Values_request: minor rewriting of function [lval_to_offsetmap].
parent
89ab73e9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/value/api/values_request.ml
+24
-23
24 additions, 23 deletions
src/plugins/value/api/values_request.ml
with
24 additions
and
23 deletions
src/plugins/value/api/values_request.ml
+
24
−
23
View file @
8a33fdcb
...
...
@@ -301,31 +301,32 @@ module Proxy(A : Analysis.S) : EvaProxy = struct
|
`Value
offsm
->
Offsetmap
offsm
with
Abstract_interp
.
Error_Top
->
Top
let
extract_or_reduce_lval
lval
state
=
match
lval
with
|
Var
vi
,
NoOffset
->
let
r
=
extract_single_var
vi
state
in
fun
_
->
r
|
_
->
fun
loc
->
reduce_loc_and_eval
loc
state
let
get_precise_loc
=
match
A
.
Loc
.
get
Main_locations
.
PLoc
.
key
with
|
None
->
fun
_
->
Precise_locs
.
loc_top
|
Some
get
->
get
let
lval_to_offsetmap
lval
state
=
let
loc
,
alarms
=
A
.
eval_lval_to_loc
state
lval
in
let
state
=
A
.
Dom
.
get_cvalue_or_top
state
in
let
extract
=
extract_or_reduce_lval
lval
state
in
let
precise_loc
=
match
A
.
Loc
.
get
Main_locations
.
PLoc
.
key
with
|
None
->
`Value
(
Precise_locs
.
loc_top
)
|
Some
get
->
loc
>>-:
get
and
f
loc
acc
=
match
acc
,
extract
loc
with
|
Offsetmap
o1
,
Offsetmap
o2
->
Offsetmap
(
Cvalue
.
V_Offsetmap
.
join
o1
o2
)
|
Bottom
,
v
|
v
,
Bottom
->
v
|
Empty
,
v
|
v
,
Empty
->
v
|
Top
,
Top
->
Top
|
InvalidLoc
,
InvalidLoc
->
InvalidLoc
|
InvalidLoc
,
(
Offsetmap
_
as
res
)
->
res
|
Offsetmap
_
,
InvalidLoc
->
acc
|
Top
,
r
|
r
,
Top
->
r
(* cannot happen, we should get Top everywhere *)
in
precise_loc
>>-:
(
fun
loc
->
Precise_locs
.
fold
f
loc
Bottom
)
,
alarms
let
cvalue
=
A
.
Dom
.
get_cvalue_or_top
state
in
match
lval
with
|
Var
vi
,
NoOffset
->
let
r
=
extract_single_var
vi
cvalue
in
`Value
r
,
Alarmset
.
none
|
_
->
A
.
eval_lval_to_loc
state
lval
>>=:
fun
loc
->
let
precise_loc
=
get_precise_loc
loc
in
let
f
loc
acc
=
match
acc
,
reduce_loc_and_eval
loc
cvalue
with
|
Offsetmap
o1
,
Offsetmap
o2
->
Offsetmap
(
Cvalue
.
V_Offsetmap
.
join
o1
o2
)
|
Bottom
,
v
|
v
,
Bottom
->
v
|
Empty
,
v
|
v
,
Empty
->
v
|
Top
,
Top
->
Top
|
InvalidLoc
,
InvalidLoc
->
InvalidLoc
|
InvalidLoc
,
(
Offsetmap
_
as
res
)
->
res
|
Offsetmap
_
,
InvalidLoc
->
acc
|
Top
,
r
|
r
,
Top
->
r
(* cannot happen, we should get Top everywhere *)
in
Precise_locs
.
fold
f
precise_loc
Bottom
type
evaluation
=
|
ToValue
of
A
.
Val
.
t
...
...
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