From 7ff74b2c472d5feff62e228a8eebb22d6ccdbc2b Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Wed, 3 May 2023 00:06:09 -0400 Subject: [PATCH] Give a better error for unsupported floating point arithmetic, instead of internal "Precondition violated" error. --- src/cc65/datatype.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cc65/datatype.c b/src/cc65/datatype.c index 6907ee099..103a3a634 100644 --- a/src/cc65/datatype.c +++ b/src/cc65/datatype.c @@ -670,6 +670,10 @@ const Type* ArithmeticConvert (const Type* lhst, const Type* rhst) ** floating point types are not (yet) supported. ** The integral promotions are performed on both operands. */ + if (IsClassFloat(lhst) || IsClassFloat(rhst)) { + Error ("Floating point arithmetic not supported."); + return type_long; + } lhst = IntPromotion (lhst); rhst = IntPromotion (rhst);