From 4e5f15c6851c69c4cc5da18209218eb918dbee77 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Mon, 3 Feb 2014 22:27:23 +0800 Subject: [PATCH] switch last 2 params of TOK_memset on ARM On ARM, TOK_memset is executed via __aeabi_memset which reverse the order of the last two parameters. --- tccgen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tccgen.c b/tccgen.c index 6a5ba03..c5e368e 100644 --- a/tccgen.c +++ b/tccgen.c @@ -5157,8 +5157,13 @@ static void init_putz(CType *t, Section *sec, unsigned long c, int size) } else { vpush_global_sym(&func_old_type, TOK_memset); vseti(VT_LOCAL, c); +#ifdef TCC_TARGET_ARM + vpushs(size); + vpushi(0); +#else vpushi(0); vpushs(size); +#endif gfunc_call(3); } }