From dfdc844ee7b08fda327798350125b6e79727dc27 Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Wed, 19 Oct 2016 16:28:55 +0200 Subject: implement checks for parameters of '__builtin_memcpy_aligned' (bug 20222) --- cfrontend/C2C.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cfrontend/C2C.ml') diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml index 85f94ad0..5d75aa6a 100644 --- a/cfrontend/C2C.ml +++ b/cfrontend/C2C.ml @@ -362,10 +362,10 @@ let make_builtin_memcpy args = match Initializers.constval !comp_env al with | Errors.OK(Vint n) -> n | _ -> error "alignment argument of '__builtin_memcpy_aligned' must be a constant"; Integers.Int.one in - if Integers.Int.is_power2 al1 = None - then error "alignment argument of '__builtin_memcpy_aligned' must be a power of 2"; - if Integers.Int.modu sz1 al1 <> Integers.Int.zero - then error "alignment argument of '__builtin_memcpy_aligned' must be a divisor of the size"; + if Integers.Int.is_power2 al1 = None then + error "alignment argument of '__builtin_memcpy_aligned' must be a power of 2"; + if Integers.Int.modu sz1 al1 <> Integers.Int.zero then + error "alignment argument of '__builtin_memcpy_aligned' must be a divisor of the size"; (* Issue #28: must decay array types to pointer types *) Ebuiltin(EF_memcpy(sz1, al1), Tcons(typeconv(typeof dst), -- cgit