commit c31a2b36325ec5d3d82ce24209a5c7f5f9a8c041
parent e4e130d48a89642db29f4aefbb8a416bbfe60abe
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 19 Jan 2016 19:28:23 +0100
Check maximum position in the initializer after increment
Max will keep the maximum size of the initializer, so it must compared
after the increment, no before
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cc1/init.c b/cc1/init.c
@@ -251,10 +251,10 @@ initlist(Type *tp)
else
newdesig(&in, np);
- if (in.pos > in.max)
- in.max = in.pos;
if (++in.pos == 0)
errorp("compound literal too big");
+ if (in.pos > in.max)
+ in.max = in.pos;
if (tp->n.elem == in.pos && !braces)
break;
} while (accept(','));