From 51e8bc524d570439f868ec0bdbf718cb53ca7669 Mon Sep 17 00:00:00 2001 From: xleroy Date: Mon, 30 Dec 2013 16:37:05 +0000 Subject: 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 --- cfrontend/Clight.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cfrontend/Clight.v') 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' -> -- cgit v1.2.3