From fbc8419464a84f284cfdcaf034bfea821c9bccfd Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Thu, 1 Jul 2010 00:03:10 +0430 Subject: [PATCH] ncc: fix ++s for pointers --- ncc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ncc.c b/ncc.c index 910c32b..3745749 100644 --- a/ncc.c +++ b/ncc.c @@ -739,20 +739,19 @@ static void readpost(void) static void inc_pre(int inc_one, int inc_many) { - struct type t; + struct type *t; int sz; readpre(); - ts_pop(&t); - array2ptr(&t); - sz = type_totsz(&t); - if (!t.ptr || sz == 1) { + t = &ts[nts - 1]; + sz = (t->flags & T_ARRAY || t->ptr) ? type_szde(t) : 1; + if (sz == 1) { o_uop(inc_one); } else { + o_tmpcopy(); o_num(sz, 4); o_bop(inc_many); - o_assign(TYPE_BT(&t)); + o_assign(TYPE_BT(t)); } - ts_push(&t); } static void readpre(void) -- 2.11.4.GIT