fixed behaviour on too long floating point constants
authorceriel <none@none>
Wed, 26 Jul 1989 11:16:59 +0000 (11:16 +0000)
committerceriel <none@none>
Wed, 26 Jul 1989 11:16:59 +0000 (11:16 +0000)
lang/cem/cemcom/LLlex.c
lang/m2/comp/LLlex.c

index 9a540f1..3ed953f 100644 (file)
@@ -445,7 +445,7 @@ firstline:
                buf[0] = '-';   /* good heavens...      */
                if (np == &buf[NUMSIZE+1]) {
                        lexerror("floating constant too long");
-                       ptok->tk_fval = Salloc("0.0",(unsigned) 5) + 1;
+                       ptok->tk_fval = Salloc("-0.0",(unsigned) 5) + 1;
                }
                else
                        ptok->tk_fval = Salloc(buf,(unsigned) (np - buf)) + 1;
index 3e0bd95..39b0790 100644 (file)
@@ -582,7 +582,7 @@ lexwarning(W_ORDINARY, "overflow in constant");
                PushBack();
 
                if (np >= &buf[NUMSIZE]) {
-                       tk->TOK_REL = Salloc("0.0", 5);
+                       tk->TOK_REL = Salloc("-0.0", 5)+1;
                        lexerror("real constant too long");
                }
                else    tk->TOK_REL = Salloc(buf, (unsigned) (np - buf)) + 1;