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
30e29676
Commit
30e29676
authored
6 years ago
by
Patrick Baudin
Browse files
Options
Downloads
Patches
Plain Diff
[wp] explicits offset of an union field
parent
60bc2c1e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/wp/ctypes.ml
+6
-3
6 additions, 3 deletions
src/plugins/wp/ctypes.ml
with
6 additions
and
3 deletions
src/plugins/wp/ctypes.ml
+
6
−
3
View file @
30e29676
...
...
@@ -464,9 +464,12 @@ let sizeof_object = function
WpLog
.
fatal
~
current
:
true
"Sizeof unknown-size array"
let
field_offset
fd
=
let
ctype
=
TComp
(
fd
.
fcomp
,
Cil
.
empty_size_cache
()
,
[]
)
in
let
offset
=
Field
(
fd
,
NoOffset
)
in
fst
(
Cil
.
bitsOffset
ctype
offset
)
/
8
if
fd
.
fcomp
.
cstruct
then
(* C struct *)
let
ctype
=
TComp
(
fd
.
fcomp
,
Cil
.
empty_size_cache
()
,
[]
)
in
let
offset
=
Field
(
fd
,
NoOffset
)
in
fst
(
Cil
.
bitsOffset
ctype
offset
)
/
8
else
(* CIL invariant: all C union fields start at offset 0 *)
0
(* Conforms to C-ISO 6.3.1.8 *)
(* If same sign => greater rank. *)
...
...
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