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
f2e883b5
Commit
f2e883b5
authored
3 years ago
by
Virgile Prevosto
Committed by
David Bühler
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[kernel] \exit_status is a special case for ast diff
parent
2b3ac2b1
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/kernel_services/ast_queries/ast_diff.ml
+24
-1
24 additions, 1 deletion
src/kernel_services/ast_queries/ast_diff.ml
tests/syntax/ast_diff_1.i
+1
-0
1 addition, 0 deletions
tests/syntax/ast_diff_1.i
tests/syntax/ast_diff_2.i
+1
-0
1 addition, 0 deletions
tests/syntax/ast_diff_2.i
with
26 additions
and
1 deletion
src/kernel_services/ast_queries/ast_diff.ml
+
24
−
1
View file @
f2e883b5
...
@@ -646,9 +646,22 @@ and is_matching_logic_var lv lv' env =
...
@@ -646,9 +646,22 @@ and is_matching_logic_var lv lv' env =
|
None
->
|
None
->
(
match
Logic_var
.
find
lv
with
(
match
Logic_var
.
find
lv
with
|
`Not_present
->
false
|
`Not_present
->
false
|
`Same
lv''
->
Cil_datatype
.
Logic_var
.
equal
lv'
lv''
))
|
`Same
lv''
->
Cil_datatype
.
Logic_var
.
equal
lv'
lv''
|
exception
Not_found
->
if
lv
.
lv_name
=
"
\\
exit_status"
&&
lv'
.
lv_name
=
"
\\
exit_status"
then
begin
Logic_var
.
add
lv
(
`Same
lv'
);
true
end
else
begin
match
logic_var_correspondance
lv
env
with
|
None
->
false
|
Some
lv''
->
Cil_datatype
.
Logic_var
.
equal
lv'
lv''
end
))
|
_
->
false
|
_
->
false
and
logic_var_correspondance
lv
env
=
match
find_candidate_logic_var
lv
env
with
|
None
->
None
|
Some
lv'
->
Logic_var
.
add
lv
(
`Same
lv'
);
Some
lv'
and
is_same_term_offset
lo
lo'
env
=
and
is_same_term_offset
lo
lo'
env
=
match
lo
,
lo'
with
match
lo
,
lo'
with
|
TNoOffset
,
TNoOffset
->
true
|
TNoOffset
,
TNoOffset
->
true
...
@@ -1212,6 +1225,16 @@ and logic_vars_env l l' env =
...
@@ -1212,6 +1225,16 @@ and logic_vars_env l l' env =
else
else
false
,
env
false
,
env
and
find_candidate_logic_var
?
loc
:_
loc
lv
env
=
let
candidates
=
Logic_env
.
find_all_logic_functions
lv
.
lv_name
in
match
List
.
find_opt
(
fun
li
->
li
.
l_profile
=
[]
)
candidates
with
|
None
->
Format
.
printf
"No such var@."
;
None
|
Some
li
->
Format
.
printf
"Found something@."
;
if
is_same_logic_var
lv
li
.
l_var_info
env
then
Some
li
.
l_var_info
else
None
(* because of overloading, we have to check for a corresponding profile,
(* because of overloading, we have to check for a corresponding profile,
leading to potentially recursive calls to is_same_* functions. *)
leading to potentially recursive calls to is_same_* functions. *)
and
find_candidate_logic_info
?
loc
:_
loc
li
env
=
and
find_candidate_logic_info
?
loc
:_
loc
li
env
=
...
...
This diff is collapsed.
Click to expand it.
tests/syntax/ast_diff_1.i
+
1
−
0
View file @
f2e883b5
...
@@ -45,6 +45,7 @@ int has_static_local(void) {
...
@@ -45,6 +45,7 @@ int has_static_local(void) {
return x;
return x;
}
}
/*@ exits \exit_status == 1; */
int
decl
(
void
)
;
int
decl
(
void
)
;
int
used_in_decl
;
int
used_in_decl
;
...
...
This diff is collapsed.
Click to expand it.
tests/syntax/ast_diff_2.i
+
1
−
0
View file @
f2e883b5
...
@@ -46,6 +46,7 @@ int has_static_local(void) {
...
@@ -46,6 +46,7 @@ int has_static_local(void) {
int
used_in_decl
;
int
used_in_decl
;
/*@ exits \exit_status == 1; */
int
decl
()
{
int
decl
()
{
used_in_decl++;
used_in_decl++;
return used_in_decl;
return used_in_decl;
...
...
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