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
dc5461df
Commit
dc5461df
authored
7 months ago
by
Cécile Ruet-Cros
Committed by
Loïc Correnson
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[region] region_of_ptr_term v.0.1 (incorrect)
parent
47a40645
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/region/Region.ml
+34
-0
34 additions, 0 deletions
src/plugins/region/Region.ml
src/plugins/region/Region.mli
+2
-0
2 additions, 0 deletions
src/plugins/region/Region.mli
with
36 additions
and
0 deletions
src/plugins/region/Region.ml
+
34
−
0
View file @
dc5461df
...
...
@@ -50,6 +50,40 @@ let field (map:map) (region:region) (field:fieldinfo) : region =
let
index
(
_
:
map
)
(
_
:
region
)
(
_
:
typ
)
:
region
=
(* TODO *)
raise
Not_found
let
region_of_ptr_term
(
map
:
map
)
(
ptr
:
term
)
:
region
=
match
ptr
.
term_node
with
(* same constructs as exp *)
|
TConst
_
|
TLval
_
|
TSizeOf
_
|
TSizeOfE
_
|
TSizeOfStr
_
|
TAlignOf
_
|
TAlignOfE
_
|
TUnOp
_
|
TBinOp
_
|
TCast
_
->
begin
match
Memory
.
exp
map
.
map
@@
Logic_to_c
.
term_to_exp
ptr
with
|
None
->
raise
Not_found
|
Some
node
->
Memory
.
region
map
.
map
node
end
|
TAddrOf
term_lval
->
Memory
.
region
map
.
map
@@
Memory
.
lval
map
.
map
@@
Logic_to_c
.
term_lval_to_lval
term_lval
|
TStartOf
term_lval
->
Memory
.
region
map
.
map
@@
Memory
.
lval
map
.
map
@@
Logic_to_c
.
term_lval_to_lval
term_lval
(* additional constructs *)
|
Tapp
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Tapp"
)
|
Tlambda
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Tlambda"
)
|
TDataCons
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: TDataCons"
)
|
Tif
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Tif"
)
|
Tat
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Tat"
)
(* logic_label * term *)
|
Tbase_addr
_
->
(* TODO *)
raise
Not_found
|
Toffset
_
->
(* TODO *)
raise
Not_found
|
Tblock_length
_
->
(* TODO *)
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Tblock_length"
)
|
Tnull
->
(* TODO *)
raise
Not_found
|
TUpdate
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: TUpdate"
)
|
Ttypeof
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Ttypeof"
)
|
Ttype
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Ttype"
)
|
Tempty_set
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Tempty_set"
)
|
Tunion
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Tunion"
)
|
Tinter
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Tinter"
)
|
Tcomprehension
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Tcomprehension"
)
|
Trange
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Trange"
)
|
Tlet
_
->
raise
(
Invalid_argument
"Region:Region.ml:region_of_ptr_term: Tlet"
)
let
points_to
(
map
:
map
)
(
region
:
region
)
:
region
option
=
Option
.
map
(
Memory
.
region
map
.
map
)
@@
Memory
.
cpointed
map
.
map
region
.
Memory
.
node
...
...
This diff is collapsed.
Click to expand it.
src/plugins/region/Region.mli
+
2
−
0
View file @
dc5461df
...
...
@@ -38,6 +38,8 @@ val cvar : map -> varinfo -> region
val
field
:
map
->
region
->
fieldinfo
->
region
val
index
:
map
->
region
->
typ
->
region
val
region_of_ptr_term
:
map
->
term
->
region
(* API POINTERS *)
val
points_to
:
map
->
region
->
region
option
val
pointed_by
:
map
->
region
->
region
list
...
...
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