[012568kqv]a: correctly lex full range of integers in the assemblers (thanks Ori_B)

The Plan 9 assemblers use strtoll to parse the integer literals
in their input. It turns out that this is almost correct, but
VLONG_MIN is clamped. This patch changes to use strtoull
in order to allow the full range of integers.
This commit is contained in:
spew 2017-03-22 00:04:24 -05:00
parent 3309f05b97
commit 8b6621a360

View file

@ -343,9 +343,9 @@ l1:
goto casee; goto casee;
*cp = 0; *cp = 0;
if(sizeof(yylval.lval) == sizeof(vlong)) if(sizeof(yylval.lval) == sizeof(vlong))
yylval.lval = strtoll(symb, nil, 10); yylval.lval = strtoull(symb, nil, 10);
else else
yylval.lval = strtol(symb, nil, 10); yylval.lval = strtoul(symb, nil, 10);
ncu: ncu:
while(c == 'U' || c == 'u' || c == 'l' || c == 'L') while(c == 'U' || c == 'u' || c == 'l' || c == 'L')