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
0acd43ee
Commit
0acd43ee
authored
13 years ago
by
Julien Signoles
Browse files
Options
Downloads
Patches
Plain Diff
[e-acsl] fix bugs of sharing between the old AST and the new one
parent
7d0e9489
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/e-acsl/visit.ml
+24
-12
24 additions, 12 deletions
src/plugins/e-acsl/visit.ml
with
24 additions
and
12 deletions
src/plugins/e-acsl/visit.ml
+
24
−
12
View file @
0acd43ee
...
...
@@ -340,7 +340,7 @@ let convert_named_predicate env p =
assert
(
Typ
.
equal
(
typeOf
e
)
intType
);
Env
.
add_stmt
env
(
Misc
.
mk_e_acsl_guard
~
reverse
:
true
e
p
)
let
convert_annotation
env
annot
=
let
convert_
code_
annotation
env
annot
=
try
match
annot
.
annot_content
with
|
AAssert
(
l
,
p
)
->
...
...
@@ -368,8 +368,6 @@ let convert_annotation env annot =
else
Options
.
warning
~
current
:
true
"%s@
\n
ignoring annotation."
msg
;
env
,
None
let
convert_rooted
env
(
User
a
|
AI
(
_
,
a
))
=
convert_annotation
env
a
(* ************************************************************************** *)
(* Visitor *)
(* ************************************************************************** *)
...
...
@@ -402,10 +400,14 @@ class e_acsl_visitor prj generate = object (self)
method
vvdec
vi
=
(* TODO: handle functions without code *)
try
let
kf
=
Globals
.
Functions
.
get
vi
in
let
pre_b
,
post_b
,
env
=
convert_spec
Env
.
empty
(
Kernel_function
.
get_spec
kf
)
let
old_vi
=
get_original_varinfo
self
#
behavior
vi
in
let
old_kf
=
Globals
.
Functions
.
get
old_vi
in
let
spec
=
Visitor
.
visitFramacFunspec
(
self
:>
Visitor
.
frama_c_visitor
)
(
Kernel_function
.
get_spec
old_kf
)
in
let
pre_b
,
post_b
,
env
=
convert_spec
Env
.
empty
spec
in
pre_block
<-
pre_b
;
post_block
<-
post_b
;
gen_vars
<-
Env
.
generated_function_variables
env
;
...
...
@@ -425,17 +427,24 @@ class e_acsl_visitor prj generate = object (self)
method
vstmt_aux
stmt
=
(* Options.debug ~level:2 "proceeding stmt %d@." stmt.sid;*)
(* [TODO] BUG HERE since the annotations tbl is the one of the old
project. *)
let
env
,
post_stmts
=
Annotations
.
single_fold_stmt
(
fun
ba
(
env
,
post_stmts
)
->
let
env
,
post_block
=
convert_rooted
env
ba
in
(
fun
(
User
old_a
|
AI
(
_
,
old_a
))
(
env
,
post_stmts
)
->
let
a
=
Visitor
.
visitFramacCodeAnnotation
(
self
:>
Visitor
.
frama_c_visitor
)
old_a
in
let
env
,
post_block
=
convert_code_annotation
env
a
in
let
post_stmts
=
match
post_block
with
|
None
->
post_stmts
|
Some
b
->
mkStmt
~
valid_sid
:
true
(
Block
b
)
::
post_stmts
in
env
,
post_stmts
)
stmt
(
get_original_stmt
self
#
behavior
stmt
)
(
Env
.
empty
,
[]
)
in
(* verify internal invariants *)
...
...
@@ -449,9 +458,12 @@ class e_acsl_visitor prj generate = object (self)
let
post_stmts
=
let
is_return
s
=
match
self
#
current_kf
with
|
None
->
false
|
Some
kf
->
try
Stmt
.
equal
s
(
Kernel_function
.
find_return
kf
)
with
Kernel_function
.
No_Statement
->
assert
false
|
Some
old_kf
->
let
old_ret
=
try
Kernel_function
.
find_return
old_kf
with
Kernel_function
.
No_Statement
->
assert
false
in
Stmt
.
equal
s
(
get_stmt
self
#
behavior
old_ret
)
in
if
is_return
stmt
then
match
post_block
with
...
...
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