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
4f787c92
Commit
4f787c92
authored
2 years ago
by
Valentin Perrelle
Browse files
Options
Downloads
Patches
Plain Diff
[Cil builder] better error handling for initializations
parent
5c67cb61
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_building/cil_builder.ml
+6
-3
6 additions, 3 deletions
src/kernel_services/ast_building/cil_builder.ml
with
6 additions
and
3 deletions
src/kernel_services/ast_building/cil_builder.ml
+
6
−
3
View file @
4f787c92
...
...
@@ -82,7 +82,7 @@ struct
|
_
,
_
->
raise
NotACType
let
structure
compinfo
f
=
Record
f
,
Ctype
(
TComp
(
compinfo
,
[]
))
Record
f
,
Ctype
(
TComp
(
compinfo
,
[]
))
(* Attrbutes *)
...
...
@@ -433,7 +433,7 @@ struct
field
,
harden_init
init
in
`init
(
StructInit
(
t
,
List
.
map2
field_init
(
Option
.
get
comp
.
cfields
)
l
))
|
_
->
assert
false
(* TODO: handle error *)
|
_
->
invalid_arg
"compound: type must be a C array, struct or union"
let
rec
values
:
type
a
.
(
init
,
a
)
typ
->
a
->
[
>
init
]
=
fun
ty
x
->
...
...
@@ -445,7 +445,10 @@ struct
field
,
harden_init
(
f
field
x
)
in
`init
(
StructInit
(
t
,
List
.
map
field_init
(
Option
.
get
comp
.
cfields
)))
|
Record
_
,
_
->
assert
false
|
Record
_
,
_
->
(* invariant: Record initializers can only be associated with C structures
or unions. *)
assert
false
|
_
,
_
->
raise
NotACType
(* Operators *)
...
...
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