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
eefaa2c0
Commit
eefaa2c0
authored
8 months ago
by
Thibault Martin
Committed by
Virgile Prevosto
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[kernel] Var is in scope if sdef == stmt
parent
9b89de8b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/kernel_services/ast_data/kernel_function.ml
+2
-0
2 additions, 0 deletions
src/kernel_services/ast_data/kernel_function.ml
src/kernel_services/ast_data/kernel_function.mli
+1
-1
1 addition, 1 deletion
src/kernel_services/ast_data/kernel_function.mli
with
3 additions
and
1 deletion
src/kernel_services/ast_data/kernel_function.ml
+
2
−
0
View file @
eefaa2c0
...
@@ -540,6 +540,8 @@ let var_is_in_scope stmt vi =
...
@@ -540,6 +540,8 @@ let var_is_in_scope stmt vi =
let
blocks
=
find_all_enclosing_blocks
stmt
in
let
blocks
=
find_all_enclosing_blocks
stmt
in
let
is_def_above
b
=
let
is_def_above
b
=
let
sdef
=
local_definition
(
find_englobing_kf
stmt
)
vi
in
let
sdef
=
local_definition
(
find_englobing_kf
stmt
)
vi
in
(* If sdef == stmt, vi is in the scope. *)
Cil_datatype
.
Stmt
.
equal
sdef
stmt
||
match
b
.
bstmts
with
match
b
.
bstmts
with
|
[]
->
assert
false
(* at least contains stmt *)
|
[]
->
assert
false
(* at least contains stmt *)
|
sfst
::
_
->
|
sfst
::
_
->
...
...
This diff is collapsed.
Click to expand it.
src/kernel_services/ast_data/kernel_function.mli
+
1
−
1
View file @
eefaa2c0
...
@@ -143,7 +143,7 @@ val local_definition: t -> varinfo -> stmt
...
@@ -143,7 +143,7 @@ val local_definition: t -> varinfo -> stmt
*)
*)
val
var_is_in_scope
:
stmt
->
varinfo
->
bool
val
var_is_in_scope
:
stmt
->
varinfo
->
bool
(** [var_is_in_scope
kf
stmt vi] returns [true] iff the local variable [vi]
(** [var_is_in_scope stmt vi] returns [true] iff the local variable [vi]
is syntactically visible from statement [stmt] in function [kf]. Note
is syntactically visible from statement [stmt] in function [kf]. Note
that on the contrary to {!Globals.Syntactic_search.find_in_scope}, the
that on the contrary to {!Globals.Syntactic_search.find_in_scope}, the
variable is searched according to its [vid], not its [vorig_name].
variable is searched according to its [vid], not its [vorig_name].
...
...
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