summaryrefslogtreecommitdiff
path: root/cfrontend/Clight.v
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-12-30 16:37:05 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-12-30 16:37:05 +0000
commit51e8bc524d570439f868ec0bdbf718cb53ca7669 (patch)
tree5211b1971bdc1df4bc231dfef90cd15e3758a7e3 /cfrontend/Clight.v
parent98089fdf4880b46a57aafa96ea00578e396bb58b (diff)
Ctypes.sizeof ty = 0 for empty types ty (zero-sized array, empty struct/union).
__builtin_memcpy_aligned now supports the case sz = 0. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2392 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend/Clight.v')
-rw-r--r--cfrontend/Clight.v4
1 files changed, 2 insertions, 2 deletions
diff --git a/cfrontend/Clight.v b/cfrontend/Clight.v
index f402ac2..59c056d 100644
--- a/cfrontend/Clight.v
+++ b/cfrontend/Clight.v
@@ -220,8 +220,8 @@ Inductive assign_loc (ty: type) (m: mem) (b: block) (ofs: int):
assign_loc ty m b ofs v m'
| assign_loc_copy: forall b' ofs' bytes m',
access_mode ty = By_copy ->
- (alignof_blockcopy ty | Int.unsigned ofs') ->
- (alignof_blockcopy ty | Int.unsigned ofs) ->
+ (sizeof ty > 0 -> (alignof_blockcopy ty | Int.unsigned ofs')) ->
+ (sizeof ty > 0 -> (alignof_blockcopy ty | Int.unsigned ofs)) ->
b' <> b \/ Int.unsigned ofs' = Int.unsigned ofs
\/ Int.unsigned ofs' + sizeof ty <= Int.unsigned ofs
\/ Int.unsigned ofs + sizeof ty <= Int.unsigned ofs' ->