summaryrefslogtreecommitdiff
path: root/sys/src/cmd/cc
diff options
context:
space:
mode:
authorspew <devnull@localhost>2017-03-22 00:04:24 -0500
committerspew <devnull@localhost>2017-03-22 00:04:24 -0500
commit8b6621a36032d2ff8b98ce89f995c8277aeb935f (patch)
tree8d2761695d80ef8fbff07dacd08275b438dacdfe /sys/src/cmd/cc
parent3309f05b976c5f18bde1383f007b01025db31fce (diff)
[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.
Diffstat (limited to 'sys/src/cmd/cc')
-rw-r--r--sys/src/cmd/cc/lexbody4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/cmd/cc/lexbody b/sys/src/cmd/cc/lexbody
index 6b226ada9..48c5ed19e 100644
--- a/sys/src/cmd/cc/lexbody
+++ b/sys/src/cmd/cc/lexbody
@@ -343,9 +343,9 @@ l1:
goto casee;
*cp = 0;
if(sizeof(yylval.lval) == sizeof(vlong))
- yylval.lval = strtoll(symb, nil, 10);
+ yylval.lval = strtoull(symb, nil, 10);
else
- yylval.lval = strtol(symb, nil, 10);
+ yylval.lval = strtoul(symb, nil, 10);
ncu:
while(c == 'U' || c == 'u' || c == 'l' || c == 'L')