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
24cea04d
Commit
24cea04d
authored
3 years ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
[kernel] filecheck checks coherence of types in assignments
parent
dc74109d
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/kernel_services/ast_queries/filecheck.ml
+9
-0
9 additions, 0 deletions
src/kernel_services/ast_queries/filecheck.ml
with
9 additions
and
0 deletions
src/kernel_services/ast_queries/filecheck.ml
+
9
−
0
View file @
24cea04d
...
@@ -1310,6 +1310,15 @@ module Base_checker = struct
...
@@ -1310,6 +1310,15 @@ module Base_checker = struct
|
Local_init
(
v
,
ConsInit
(
f
,
args
,
k
)
,
loc
)
->
|
Local_init
(
v
,
ConsInit
(
f
,
args
,
k
)
,
loc
)
->
self
#
check_initialized_var
v
;
self
#
check_initialized_var
v
;
Cil
.
treat_constructor_as_func
treat_call
v
f
args
k
loc
Cil
.
treat_constructor_as_func
treat_call
v
f
args
k
loc
|
Set
(
lv
,
rv
,
_
)
->
let
t1
=
Cil
.
typeOfLval
lv
in
let
t2
=
Cil
.
typeOf
rv
in
if
not
(
is_admissible_conversion
rv
t2
t1
)
then
check_abort
"Incompatible types in assignment %a:\
location has type %a, value has type %a"
Printer
.
pp_instr
i
Printer
.
pp_typ
t1
Printer
.
pp_typ
t2
;
Cil
.
DoChildren
|
Asm
(
_
,_,
Some
{
asm_gotos
}
,_
)
->
|
Asm
(
_
,_,
Some
{
asm_gotos
}
,_
)
->
List
.
iter
self
#
check_label
asm_gotos
;
Cil
.
DoChildren
List
.
iter
self
#
check_label
asm_gotos
;
Cil
.
DoChildren
|
_
->
Cil
.
DoChildren
|
_
->
Cil
.
DoChildren
...
...
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