From 624acc18eff51100116c4af09cab9fdbd51f54e6 Mon Sep 17 00:00:00 2001 From: Teddy Date: Thu, 1 May 2014 14:03:12 +0800 Subject: ... --- semantics.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/semantics.c b/semantics.c index 1361dd6..50eb924 100644 --- a/semantics.c +++ b/semantics.c @@ -1870,10 +1870,14 @@ void semantics_check(CNode *p) { size = 0; for (p = func->rec.func.params; p; p = p->next) { + CType_t t = p->type; /* force to a word alignment */ size += align_shift(size); p->start = size; - size += calc_size(p->type); + if (t->type == CARR) + size += PTR_SIZE; + else + size += calc_size(t); } size = 0; for (p = func->rec.func.local; p; p = p->next) -- cgit v1.2.3