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
18768a6a
Commit
18768a6a
authored
8 years ago
by
Kostyantyn Vorobyov
Browse files
Options
Downloads
Patches
Plain Diff
Reset function
parent
4c5f1cdf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugins/e-acsl/exit_points.ml
+10
-5
10 additions, 5 deletions
src/plugins/e-acsl/exit_points.ml
src/plugins/e-acsl/exit_points.mli
+3
-0
3 additions, 0 deletions
src/plugins/e-acsl/exit_points.mli
src/plugins/e-acsl/visit.ml
+4
-3
4 additions, 3 deletions
src/plugins/e-acsl/visit.ml
with
17 additions
and
8 deletions
src/plugins/e-acsl/exit_points.ml
+
10
−
5
View file @
18768a6a
...
...
@@ -46,10 +46,15 @@ let labelled_jumps:
stmt
Stmt
.
Hashtbl
.
t
=
Stmt
.
Hashtbl
.
create
17
(* Map labelled statements back to gotos which lead to them *)
let
clear
()
=
Stmt
.
Hashtbl
.
clear
statement_locals
;
Stmt
.
Hashtbl
.
clear
exit_context
;
Stmt
.
Hashtbl
.
clear
labelled_jumps
let
reset
()
=
Stmt
.
Hashtbl
.
reset
statement_locals
;
Stmt
.
Hashtbl
.
reset
exit_context
;
Stmt
.
Hashtbl
.
reset
labelled_jumps
let
empty
()
=
Stmt
.
Hashtbl
.
length
statement_locals
=
0
&&
Stmt
.
Hashtbl
.
length
exit_context
=
0
&&
Stmt
.
Hashtbl
.
length
labelled_jumps
=
0
let
filter_vars
varlst1
varlst2
=
let
s1
=
Varinfo
.
Set
.
of_list
varlst1
in
...
...
@@ -127,5 +132,5 @@ class jump_context = object (self)
end
let
generate
fct
=
clear
(
)
;
assert
(
empty
()
);
let
_
=
Cil
.
visitCilFunction
(
new
jump_context
:>
Cil
.
cilVisitor
)
fct
in
()
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/exit_points.mli
+
3
−
0
View file @
18768a6a
...
...
@@ -31,6 +31,9 @@
val
generate
:
Cil_types
.
fundec
->
unit
(** Visit a function and populate data structures used to compute exit points *)
val
reset
:
unit
->
unit
(** Clear all gathered data *)
val
delete_vars
:
Cil_types
.
stmt
->
Cil_types
.
varinfo
list
(** Given a statement which potentially leads to an early scope exit (such as
goto, break or continue) return the list of local variables which
...
...
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/visit.ml
+
4
−
3
View file @
18768a6a
...
...
@@ -370,19 +370,20 @@ you must call function `%s' and `__e_acsl_memory_clean by yourself.@]"
f
.
sbody
.
blocals
<-
blocks
method
!
vfunc
f
=
Exit_points
.
generate
f
;
if
generate
then
if
generate
then
begin
Exit_points
.
generate
f
;
let
kf
=
Extlib
.
the
self
#
current_kf
in
Options
.
feedback
~
dkey
~
level
:
2
"entering in function %a."
Kernel_function
.
pretty
kf
;
List
.
iter
(
fun
vi
->
vi
.
vghost
<-
false
)
f
.
slocals
;
Cil
.
DoChildrenPost
(
fun
f
->
Exit_points
.
reset
()
;
self
#
add_generated_variables_in_function
f
;
Options
.
feedback
~
dkey
~
level
:
2
"function %a done."
Kernel_function
.
pretty
kf
;
f
)
else
end
else
Cil
.
DoChildren
method
private
is_return
old_kf
stmt
=
...
...
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