From 55edd9487813518d67566002d88cc7394cc0c61a Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Mon, 7 Nov 2016 13:34:56 +0100 Subject: extend constant check for builtin_memcpy_aligned (bug 20320) --- cfrontend/C2C.ml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cfrontend/C2C.ml') diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml index a1ca48d1..43a18a52 100644 --- a/cfrontend/C2C.ml +++ b/cfrontend/C2C.ml @@ -365,10 +365,12 @@ let make_builtin_memcpy args = let sz1 = match Initializers.constval !comp_env sz with | Errors.OK(Vint n) -> n + | Errors.OK(Vlong n) -> n | _ -> error "size argument of '__builtin_memcpy_aligned' must be a constant"; Integers.Int.zero in let al1 = match Initializers.constval !comp_env al with | Errors.OK(Vint n) -> n + | Errors.OK(Vlong 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"; -- cgit