From 5f35d0c6444e95c758d5f5ac7125c6f63184f22d Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 26 Jul 1989 11:16:59 +0000 Subject: [PATCH] fixed behaviour on too long floating point constants --- lang/cem/cemcom/LLlex.c | 2 +- lang/m2/comp/LLlex.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cem/cemcom/LLlex.c b/lang/cem/cemcom/LLlex.c index 9a540f13c..3ed953f7f 100644 --- a/lang/cem/cemcom/LLlex.c +++ b/lang/cem/cemcom/LLlex.c @@ -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; diff --git a/lang/m2/comp/LLlex.c b/lang/m2/comp/LLlex.c index 3e0bd9548..39b07907b 100644 --- a/lang/m2/comp/LLlex.c +++ b/lang/m2/comp/LLlex.c @@ -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; -- 2.34.1