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
a5985b63
Commit
a5985b63
authored
2 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[kernel] Ast_diff: compares case labels of corresponding statements.
parent
eff54b79
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/kernel_services/ast_queries/ast_diff.ml
+16
-1
16 additions, 1 deletion
src/kernel_services/ast_queries/ast_diff.ml
with
16 additions
and
1 deletion
src/kernel_services/ast_queries/ast_diff.ml
+
16
−
1
View file @
a5985b63
...
...
@@ -1072,6 +1072,18 @@ and is_same_extended_asm a a' env =
in
(
res
,
env
)
&&&
is_same_list_env
bind
a
.
asm_gotos
a'
.
asm_gotos
(* Only compare case labels of statements. *)
and
are_same_case_labels
l
l'
env
=
let
l
=
List
.
filter
Cil
.
is_case_label
l
in
let
l'
=
List
.
filter
Cil
.
is_case_label
l'
in
let
is_same_case_label
lbl
lbl'
env
=
match
lbl
,
lbl'
with
|
Default
_
,
Default
_
->
true
|
Case
(
e
,
_
)
,
Case
(
e'
,
_
)
->
is_same_exp
e
e'
env
|
_
,
_
->
false
in
is_same_list
is_same_case_label
l
l'
env
and
is_same_instr
i
i'
env
:
body_correspondance
*
is_same_env
=
match
i
,
i'
with
|
Set
(
lv
,
e
,_
)
,
Set
(
lv'
,
e'
,_
)
->
...
...
@@ -1131,7 +1143,10 @@ and is_same_stmt s s' env =
let
annots'
=
Annotations
.
code_annot
s'
in
let
annot_res
=
is_same_list
is_same_code_annotation
annots
annots'
env
in
let
code_res
,
env
=
if
s
.
ghost
=
s'
.
ghost
&&
Cil_datatype
.
Attributes
.
equal
s
.
sattr
s'
.
sattr
then
if
s
.
ghost
=
s'
.
ghost
&&
Cil_datatype
.
Attributes
.
equal
s
.
sattr
s'
.
sattr
&&
are_same_case_labels
s
.
labels
s'
.
labels
env
then
begin
match
s
.
skind
,
s'
.
skind
with
|
Instr
i
,
Instr
i'
->
is_same_instr
i
i'
env
...
...
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