[hackers] [scc] Check maximum position in the initializer after increment || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 19 Jan 2016 19:33:26 +0100 (CET)

commit c31a2b36325ec5d3d82ce24209a5c7f5f9a8c041
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Jan 19 19:28:23 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Jan 19 19:28:23 2016 +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

diff --git a/cc1/init.c b/cc1/init.c
index 843fad0..4ac5996 100644
--- a/cc1/init.c
+++ b/cc1/init.c
_AT_@ -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(','));
Received on Tue Jan 19 2016 - 19:33:26 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 19 2016 - 19:36:13 CET