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
061b5aa8
Commit
061b5aa8
authored
4 years ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
[rte] fatal error if accessing an object whose type is an undefined union
parent
8fa891ec
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/rte/rte.ml
+9
-6
9 additions, 6 deletions
src/plugins/rte/rte.ml
with
9 additions
and
6 deletions
src/plugins/rte/rte.ml
+
9
−
6
View file @
061b5aa8
...
...
@@ -111,15 +111,18 @@ let lval_initialized_assertion ~remove_trivial:_ ~on_alarm lv =
|
NoOffset
->
begin
match
typ
with
|
TComp
({
cstruct
=
false
;
cfields
}
,_,_
)
->
|
TComp
({
cstruct
=
false
;
cfields
;
cname
}
,_,_
)
->
(
match
cfields
with
|
Some
[]
|
None
->
()
(* empty union, supported by gcc with size 0.
Trivially initialized. *)
|
_
->
|
None
->
Options
.
fatal
"Access to an object of undefined union %a"
Printer
.
pp_varname
cname
|
Some
[]
->
()
(* empty union, supported by gcc with size 0.
Trivially initialized. *)
|
Some
l
->
let
llv
=
List
.
map
(
fun
fi
->
Cil
.
addOffsetLval
(
Field
(
fi
,
NoOffset
))
lv
)
(
Option
.
get
cfields
)
(
fun
fi
->
Cil
.
addOffsetLval
(
Field
(
fi
,
NoOffset
))
lv
)
l
in
if
default
then
on_alarm
~
invalid
:
false
(
Alarms
.
Uninitialized_union
llv
))
...
...
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