diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2015-03-10 15:18:29 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2015-03-10 15:18:29 +0100 |
commit | e00261d59ed14721c4b0baab6cd5fe12aeaa06c6 (patch) | |
tree | e7e927001648b5d53211c939e455ea6e0b3619bb | |
parent | 337dddf6ea7c69c06c883ce4287ddf3d92b63c05 (diff) | |
download | compcert-e00261d59ed14721c4b0baab6cd5fe12aeaa06c6.tar.gz compcert-e00261d59ed14721c4b0baab6cd5fe12aeaa06c6.zip |
Issue #28: if the arguments of __builtin_memcpy_aligned are arrays, their types must decay to pointer types in the "types" part of Ebuiltin.
-rw-r--r-- | cfrontend/C2C.ml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml index 0ccf569b..2b9a54a4 100644 --- a/cfrontend/C2C.ml +++ b/cfrontend/C2C.ml @@ -365,8 +365,10 @@ a constant)"; Integers.Int.zero in | _ -> error "ill-formed __builtin_memcpy_aligned (4th argument must be a constant)"; Integers.Int.one in (* to check: sz1 > 0, al1 divides sz1, al1 = 1|2|4|8 *) + (* Issue #28: must decay array types to pointer types *) Ebuiltin(EF_memcpy(sz1, al1), - Tcons(typeof dst, Tcons(typeof src, Tnil)), + Tcons(typeconv(typeof dst), + Tcons(typeconv(typeof src), Tnil)), Econs(dst, Econs(src, Enil)), Tvoid) | _ -> assert false |