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
bb481ec2
Commit
bb481ec2
authored
5 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[wp] MemVar initialized fixes issue with typing + havoc some variables
parent
7222b10b
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/wp/Lang.ml
+6
-1
6 additions, 1 deletion
src/plugins/wp/Lang.ml
src/plugins/wp/MemVar.ml
+4
-0
4 additions, 0 deletions
src/plugins/wp/MemVar.ml
with
10 additions
and
1 deletion
src/plugins/wp/Lang.ml
+
6
−
1
View file @
bb481ec2
...
@@ -168,6 +168,10 @@ let sort_of_object = function
...
@@ -168,6 +168,10 @@ let sort_of_object = function
|
C_float
_
->
Logic
.
Sreal
|
C_float
_
->
Logic
.
Sreal
|
C_pointer
_
|
C_comp
_
|
C_array
_
->
Logic
.
Sdata
|
C_pointer
_
|
C_comp
_
|
C_array
_
->
Logic
.
Sdata
let
init_sort_of_object
=
function
|
C_int
_
|
C_float
_
|
C_pointer
_
->
Logic
.
Sbool
|
C_comp
_
|
C_array
_
->
Logic
.
Sdata
let
sort_of_ctype
t
=
sort_of_object
(
Ctypes
.
object_of
t
)
let
sort_of_ctype
t
=
sort_of_object
(
Ctypes
.
object_of
t
)
let
sort_of_ltype
t
=
match
Logic_utils
.
unroll_type
~
unroll_typedef
:
false
t
with
let
sort_of_ltype
t
=
match
Logic_utils
.
unroll_type
~
unroll_typedef
:
false
t
with
...
@@ -402,7 +406,8 @@ struct
...
@@ -402,7 +406,8 @@ struct
let
sort
=
function
let
sort
=
function
|
Mfield
(
_
,_,_,
s
)
->
Qed
.
Kind
.
of_tau
s
|
Mfield
(
_
,_,_,
s
)
->
Qed
.
Kind
.
of_tau
s
|
Cfield
(
f
,
_
)
->
sort_of_object
(
Ctypes
.
object_of
f
.
ftype
)
|
Cfield
(
f
,
KValue
)
->
sort_of_object
(
Ctypes
.
object_of
f
.
ftype
)
|
Cfield
(
f
,
KInit
)
->
init_sort_of_object
(
Ctypes
.
object_of
f
.
ftype
)
end
end
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/MemVar.ml
+
4
−
0
View file @
bb481ec2
...
@@ -1338,6 +1338,8 @@ struct
...
@@ -1338,6 +1338,8 @@ struct
let
p
=
Vset
.
in_range
(
e_var
k
)
a
b
in
let
p
=
Vset
.
in_range
(
e_var
k
)
a
b
in
let
ofs
=
ofs_shift
elt
(
e_var
k
)
ofs
in
let
ofs
=
ofs_shift
elt
(
e_var
k
)
ofs
in
let
obj_x
=
Ctypes
.
object_of
x
.
vtype
in
let
obj_x
=
Ctypes
.
object_of
x
.
vtype
in
let
init
=
e_var
(
Lang
.
freshvar
~
basename
:
"v"
(
init_of_object
obj_x
))
in
(
memvar_set_init
seq
(
Val
(
m
,
x
,
[]
))
init
)
::
Assert
(
monotonic_initialized
seq
obj_x
x
[]
)
::
Assert
(
monotonic_initialized
seq
obj_x
x
[]
)
::
(
assigned_genset
seq
[
k
]
m
x
ofs
p
)
(
assigned_genset
seq
[
k
]
m
x
ofs
p
)
...
@@ -1350,6 +1352,8 @@ struct
...
@@ -1350,6 +1352,8 @@ struct
M
.
assigned
(
mseq_of_seq
seq
)
obj
(
Sdescr
(
xs
,
mloc_of_path
m
x
ofs
,
p
))
M
.
assigned
(
mseq_of_seq
seq
)
obj
(
Sdescr
(
xs
,
mloc_of_path
m
x
ofs
,
p
))
|
Val
((
CVAL
|
CREF
)
as
m
,
x
,
ofs
)
->
|
Val
((
CVAL
|
CREF
)
as
m
,
x
,
ofs
)
->
let
obj_x
=
Ctypes
.
object_of
x
.
vtype
in
let
obj_x
=
Ctypes
.
object_of
x
.
vtype
in
let
init
=
e_var
(
Lang
.
freshvar
~
basename
:
"v"
(
init_of_object
obj_x
))
in
(
memvar_set_init
seq
(
Val
(
m
,
x
,
[]
))
init
)
::
Assert
(
monotonic_initialized
seq
obj_x
x
[]
)
::
Assert
(
monotonic_initialized
seq
obj_x
x
[]
)
::
(
assigned_genset
seq
xs
m
x
ofs
p
)
(
assigned_genset
seq
xs
m
x
ofs
p
)
...
...
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