Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
frama-c
Commits
a05672c3
Commit
a05672c3
authored
Jun 23, 2020
by
Virgile Prevosto
Browse files
[logic] keep_empty parameter in add_code_annot actually does something
parent
0d9bf98c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/kernel_services/ast_data/annotations.ml
View file @
a05672c3
...
...
@@ -1159,20 +1159,19 @@ let add_code_annot ?(keep_empty=true) emitter ?kf stmt ca =
let
filter
e
ca
=
Emitter
.
equal
e
emitter
&&
filter_ca
ca
in
let
ca_e
=
code_annot_emitter
~
filter
stmt
in
let
ca_total
=
code_annot
~
filter
:
filter_ca
stmt
in
let
new
_a
=
let
old
_a
=
match
ca_e
with
|
[]
->
a
|
[]
->
WritesAny
|
[
{
annot_content
=
AAssigns
(
_
,
assigns'
)
}
as
ca
,_
]
->
remove_code_annot_internal
emitter
~
kf
stmt
ca
;
let
merged
=
merge_assigns
~
keep_empty
assigns'
assigns
in
{
a
with
annot_content
=
AAssigns
(
bhvs
,
merged
)
}
assigns'
|
_
->
Kernel
.
fatal
"More than one loop assigns clause for a statement. \
Annotations internal state broken."
in
let
merged
=
merge_assigns
~
keep_empty
old_a
assigns
in
let
new_a
=
{
a
with
annot_content
=
AAssigns
(
bhvs
,
merged
)
}
in
let
ips
=
match
ca_total
with
|
[]
->
Property
.
ip_of_code_annot
kf
stmt
a
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment