fixed behaviour on too long floating point constants
This commit is contained in:
parent
90101c0dec
commit
5f35d0c644
2 changed files with 2 additions and 2 deletions
|
@ -445,7 +445,7 @@ firstline:
|
||||||
buf[0] = '-'; /* good heavens... */
|
buf[0] = '-'; /* good heavens... */
|
||||||
if (np == &buf[NUMSIZE+1]) {
|
if (np == &buf[NUMSIZE+1]) {
|
||||||
lexerror("floating constant too long");
|
lexerror("floating constant too long");
|
||||||
ptok->tk_fval = Salloc("0.0",(unsigned) 5) + 1;
|
ptok->tk_fval = Salloc("-0.0",(unsigned) 5) + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ptok->tk_fval = Salloc(buf,(unsigned) (np - buf)) + 1;
|
ptok->tk_fval = Salloc(buf,(unsigned) (np - buf)) + 1;
|
||||||
|
|
|
@ -582,7 +582,7 @@ lexwarning(W_ORDINARY, "overflow in constant");
|
||||||
PushBack();
|
PushBack();
|
||||||
|
|
||||||
if (np >= &buf[NUMSIZE]) {
|
if (np >= &buf[NUMSIZE]) {
|
||||||
tk->TOK_REL = Salloc("0.0", 5);
|
tk->TOK_REL = Salloc("-0.0", 5)+1;
|
||||||
lexerror("real constant too long");
|
lexerror("real constant too long");
|
||||||
}
|
}
|
||||||
else tk->TOK_REL = Salloc(buf, (unsigned) (np - buf)) + 1;
|
else tk->TOK_REL = Salloc(buf, (unsigned) (np - buf)) + 1;
|
||||||
|
|
Loading…
Reference in a new issue