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
...
@@ -301,31 +301,32 @@ module Proxy(A : Analysis.S) : EvaProxy = struct
|
`Value
offsm
->
Offsetmap
offsm
|
`Value
offsm
->
Offsetmap
offsm
with
Abstract_interp
.
Error_Top
->
Top
with
Abstract_interp
.
Error_Top
->
Top
let
extract_or_reduce_lval
lval
state
=
let
get_precise_loc
=
match
lval
with
match
A
.
Loc
.
get
Main_locations
.
PLoc
.
key
with
|
Var
vi
,
NoOffset
->
let
r
=
extract_single_var
vi
state
in
fun
_
->
r
|
None
->
fun
_
->
Precise_locs
.
loc_top
|
_
->
fun
loc
->
reduce_loc_and_eval
loc
state
|
Some
get
->
get
let
lval_to_offsetmap
lval
state
=
let
lval_to_offsetmap
lval
state
=
let
loc
,
alarms
=
A
.
eval_lval_to_loc
state
lval
in
let
cvalue
=
A
.
Dom
.
get_cvalue_or_top
state
in
let
state
=
A
.
Dom
.
get_cvalue_or_top
state
in
match
lval
with
let
extract
=
extract_or_reduce_lval
lval
state
in
|
Var
vi
,
NoOffset
->
let
precise_loc
=
let
r
=
extract_single_var
vi
cvalue
in
match
A
.
Loc
.
get
Main_locations
.
PLoc
.
key
with
`Value
r
,
Alarmset
.
none
|
None
->
`Value
(
Precise_locs
.
loc_top
)
|
_
->
|
Some
get
->
loc
>>-:
get
A
.
eval_lval_to_loc
state
lval
>>=:
fun
loc
->
and
f
loc
acc
=
let
precise_loc
=
get_precise_loc
loc
in
match
acc
,
extract
loc
with
let
f
loc
acc
=
|
Offsetmap
o1
,
Offsetmap
o2
->
Offsetmap
(
Cvalue
.
V_Offsetmap
.
join
o1
o2
)
match
acc
,
reduce_loc_and_eval
loc
cvalue
with
|
Bottom
,
v
|
v
,
Bottom
->
v
|
Offsetmap
o1
,
Offsetmap
o2
->
Offsetmap
(
Cvalue
.
V_Offsetmap
.
join
o1
o2
)
|
Empty
,
v
|
v
,
Empty
->
v
|
Bottom
,
v
|
v
,
Bottom
->
v
|
Top
,
Top
->
Top
|
Empty
,
v
|
v
,
Empty
->
v
|
InvalidLoc
,
InvalidLoc
->
InvalidLoc
|
Top
,
Top
->
Top
|
InvalidLoc
,
(
Offsetmap
_
as
res
)
->
res
|
InvalidLoc
,
InvalidLoc
->
InvalidLoc
|
Offsetmap
_
,
InvalidLoc
->
acc
|
InvalidLoc
,
(
Offsetmap
_
as
res
)
->
res
|
Top
,
r
|
r
,
Top
->
r
(* cannot happen, we should get Top everywhere *)
|
Offsetmap
_
,
InvalidLoc
->
acc
in
|
Top
,
r
|
r
,
Top
->
r
(* cannot happen, we should get Top everywhere *)
precise_loc
>>-:
(
fun
loc
->
Precise_locs
.
fold
f
loc
Bottom
)
,
alarms
in
Precise_locs
.
fold
f
precise_loc
Bottom
type
evaluation
=
type
evaluation
=
|
ToValue
of
A
.
Val
.
t
|
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