From 7e378c0215c99d7f8bd38341081ec04fd202fd0a Mon Sep 17 00:00:00 2001 From: xleroy Date: Sun, 16 Oct 2011 07:37:28 +0000 Subject: Revised emulation of packed structs git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1729 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- cparser/Cutil.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cparser/Cutil.ml') 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 *) -- cgit v1.2.3