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/Initializers.v | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'cfrontend/Initializers.v') diff --git a/cfrontend/Initializers.v b/cfrontend/Initializers.v index fa54627d..1b339c18 100644 --- a/cfrontend/Initializers.v +++ b/cfrontend/Initializers.v @@ -175,12 +175,7 @@ Fixpoint transl_init (ty: type) (i: initializer) | Init_single a, _ => do d <- transl_init_single ty a; OK (d :: nil) | Init_compound il, Tarray tyelt nelt _ => - if zle nelt 0 then - OK (Init_space(sizeof ty) :: nil) - else - transl_init_array tyelt il nelt - | Init_compound il, Tstruct _ Fnil _ => - OK (Init_space (sizeof ty) :: nil) + transl_init_array tyelt il (Zmax 0 nelt) | Init_compound il, Tstruct id fl _ => transl_init_struct id ty fl il 0 | Init_compound il, Tunion _ Fnil _ => -- cgit