commit 91c841038b2cc8dcd84bd6dc6415453062e245b5
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Wed May 11 11:54:29 2016 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Wed May 11 12:19:27 2016 +0200

    [cc1] Fix lower case hexadecimal numbers
    
    We were using the strchr approach to convert from a hexadecimal
    number to a quantity, but we only had upper case digits in our
    array, so something like 0x7fff will generate a very weird number

diff --git a/cc1/lex.c b/cc1/lex.c
index d21640a..bcd707a 100644
--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -274,7 +274,7 @@ readint(char *s, int base, int sign, Symbol *sym)
 
        for (u = 0; isxdigit(c = *s++); u = u*base + val) {
                static char letters[] = "0123456789ABCDEF";
-               val = strchr(letters, c) - letters;
+               val = strchr(letters, toupper(c)) - letters;
        repeat:
                if (u <= max/base && u*base <= max - val)
                        continue;

Reply via email to