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
d1291507
Commit
d1291507
authored
5 years ago
by
Basile Desloges
Browse files
Options
Downloads
Patches
Plain Diff
[eacsl:analyses] Add tracking of jumps from switch to case statements
parent
ac77a3b1
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/src/analyses/exit_points.ml
+10
-3
10 additions, 3 deletions
src/plugins/e-acsl/src/analyses/exit_points.ml
with
10 additions
and
3 deletions
src/plugins/e-acsl/src/analyses/exit_points.ml
+
10
−
3
View file @
d1291507
...
...
@@ -58,7 +58,8 @@ module SLocals = Build_env(struct type t = Varinfo.Set.t end)
done for consistency, so all required information is stored uniformly. *)
module
Exits
=
Build_env
(
struct
type
t
=
stmt
end
)
(* Map labelled statements back to gotos which lead to them *)
(* Map labelled statements back to gotos which lead to them and case statements
back to the corresponding switch *)
module
LJumps
=
Build_env
(
struct
type
t
=
stmt
end
)
let
clear
()
=
...
...
@@ -117,11 +118,17 @@ class jump_context = object (_)
|
[]
->
()
|
_
::
_
->
SLocals
.
add
stmt
(
unify_sets
locals
)
in
match
stmt
.
skind
with
|
Loop
_
|
Switch
_
->
let
handle_jumps
stmt
=
SLocals
.
add
stmt
(
unify_sets
locals
);
Stack
.
push
stmt
jumps
;
Cil
.
DoChildrenPost
(
fun
st
->
ignore
(
Stack
.
pop
jumps
);
st
)
in
match
stmt
.
skind
with
|
Loop
_
->
handle_jumps
stmt
|
Switch
(
_
,
_
,
case_stmts
,
_
)
->
List
.
iter
(
fun
s
->
LJumps
.
add
s
stmt
)
case_stmts
;
handle_jumps
stmt
|
Break
_
|
Continue
_
->
Exits
.
add
stmt
(
Stack
.
top
jumps
);
SLocals
.
add
stmt
(
unify_sets
locals
);
...
...
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