summaryrefslogtreecommitdiff
path: root/cparser/Cutil.ml
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-10-16 07:37:28 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-10-16 07:37:28 +0000
commit7e378c0215c99d7f8bd38341081ec04fd202fd0a (patch)
tree1a17a6568e1c421c2543d3576c97f9296ca15179 /cparser/Cutil.ml
parente8bd77565422ab8e6d2fdd4ec7d5e7e4916ff2bd (diff)
Revised emulation of packed structs
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1729 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser/Cutil.ml')
-rw-r--r--cparser/Cutil.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/cparser/Cutil.ml b/cparser/Cutil.ml
index 448f488..40b55e9 100644
--- a/cparser/Cutil.ml
+++ b/cparser/Cutil.ml
@@ -731,11 +731,13 @@ let eassign e1 e2 = { edesc = EBinop(Oassign, e1, e2, e1.etyp); etyp = e1.etyp }
let ecomma e1 e2 = { edesc = EBinop(Ocomma, e1, e2, e2.etyp); etyp = e2.etyp }
(* Construct an address-of expression. Can be applied not just to
- an l-value but also to a sequence. *)
+ an l-value but also to a sequence or a conditional of l-values. *)
let rec eaddrof e =
match e.edesc with
| EBinop(Ocomma, e1, e2, _) -> ecomma e1 (eaddrof e2)
+ | EConditional(e1, e2, e3) ->
+ { edesc = EConditional(e1, eaddrof e2, eaddrof e3); etyp = TPtr(e.etyp, []) }
| _ -> { edesc = EUnop(Oaddrof, e); etyp = TPtr(e.etyp, []) }
(* Construct a sequence *)