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
e69e9aef
Commit
e69e9aef
authored
5 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[wp] Initialized arrays in MemLoader
parent
fd725548
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/wp/MemLoader.ml
+30
-26
30 additions, 26 deletions
src/plugins/wp/MemLoader.ml
with
30 additions
and
26 deletions
src/plugins/wp/MemLoader.ml
+
30
−
26
View file @
e69e9aef
...
...
@@ -396,26 +396,6 @@ struct
let
havoc
seq
obj
loc
=
havoc_length
seq
obj
loc
F
.
e_one
(* -------------------------------------------------------------------------- *)
(* --- Stored & Copied --- *)
(* -------------------------------------------------------------------------- *)
let
updated
seq
phi_store
alpha
loc
value
=
let
chunk_store
,
mem_store
=
phi_store
seq
.
pre
alpha
loc
value
in
let
chunk_init
,
mem_init
=
M
.
init_atom
seq
.
pre
loc
in
[
Set
(
Sigma
.
value
seq
.
post
chunk_store
,
mem_store
)
;
Set
(
Sigma
.
value
seq
.
post
chunk_init
,
mem_init
)]
let
stored
seq
obj
loc
value
=
match
obj
with
|
C_int
i
->
updated
seq
M
.
store_int
i
loc
value
|
C_float
f
->
updated
seq
M
.
store_float
f
loc
value
|
C_pointer
ty
->
updated
seq
M
.
store_pointer
ty
loc
value
|
C_comp
_
|
C_array
_
->
Set
(
loadvalue
seq
.
post
obj
loc
,
value
)
::
havoc
seq
obj
loc
let
copied
s
obj
p
q
=
stored
s
obj
p
(
loadvalue
s
.
pre
obj
q
)
(* -------------------------------------------------------------------------- *)
(* --- Initialized --- *)
(* -------------------------------------------------------------------------- *)
...
...
@@ -434,17 +414,41 @@ struct
let
obj_e
,
ds
=
Matrix
.
of_array
ai
in
let
denv
=
Matrix
.
denv
ds
in
let
values
=
List
.
fold_left
e_get
term
denv
.
index_val
in
let
size_eq
size
value
=
let
make_subst
var
value
p
=
match
value
with
|
None
->
p_true
|
Some
i
->
p_equal
size
(
e_int
i
)
|
None
->
p
|
Some
i
->
p_subst_var
var
(
e_int
i
)
p
in
let
substs
=
List
.
map2
make_subst
denv
.
size_var
ds
in
let
conj
=
List
.
fold_left
(
fun
p
f
->
f
p
)
(
p_conj
denv
.
index_range
)
substs
in
let
sizes
=
List
.
map2
size_eq
denv
.
size_val
ds
in
p_hyps
(
denv
.
index_range
@
sizes
)
(
initialized_term
obj_e
values
)
p_imply
conj
(
initialized_term
obj_e
values
)
let
initialized_loc
sigma
obj
loc
=
initialized_term
obj
(
initvalue
sigma
obj
loc
)
(* -------------------------------------------------------------------------- *)
(* --- Stored & Copied --- *)
(* -------------------------------------------------------------------------- *)
let
updated
seq
phi_store
alpha
loc
value
=
let
chunk_store
,
mem_store
=
phi_store
seq
.
pre
alpha
loc
value
in
let
chunk_init
,
mem_init
=
M
.
init_atom
seq
.
pre
loc
in
[
Set
(
Sigma
.
value
seq
.
post
chunk_store
,
mem_store
)
;
Set
(
Sigma
.
value
seq
.
post
chunk_init
,
mem_init
)]
let
stored
seq
obj
loc
value
=
match
obj
with
|
C_int
i
->
updated
seq
M
.
store_int
i
loc
value
|
C_float
f
->
updated
seq
M
.
store_float
f
loc
value
|
C_pointer
ty
->
updated
seq
M
.
store_pointer
ty
loc
value
|
C_comp
_
|
C_array
_
->
Assert
(
p_close
(
initialized_loc
seq
.
post
obj
loc
))
::
Set
(
loadvalue
seq
.
post
obj
loc
,
value
)
::
havoc
seq
obj
loc
let
copied
s
obj
p
q
=
stored
s
obj
p
(
loadvalue
s
.
pre
obj
q
)
(* -------------------------------------------------------------------------- *)
(* --- Assigned --- *)
(* -------------------------------------------------------------------------- *)
...
...
@@ -481,7 +485,7 @@ struct
assigned_range
seq
obj
loc
a
b
(* -------------------------------------------------------------------------- *)
(* --- Domain --- *)
(* --- Domain
--- *)
(* -------------------------------------------------------------------------- *)
let
domain
obj
loc
=
...
...
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