From c5c44ece0e87336e2e7bef6e5f556f966e6adb27 Mon Sep 17 00:00:00 2001 From: johanknol Date: Sat, 15 Sep 2001 15:37:44 +0000 Subject: [PATCH] a possible fix for bug #460662 part 2 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1272 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCicode.c | 2 +- src/SDCCicode.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SDCCicode.c b/src/SDCCicode.c index 919b9526..2c99d04a 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -2400,7 +2400,7 @@ geniCodeLogic (operand * left, operand * right, int op) /* left is integral type and right is literal then check if the literal value is within bounds */ - if (IS_INTEGRAL (ltype) && IS_LITERAL (rtype)) + if (IS_INTEGRAL (ltype) && IS_VALOP (right) && IS_LITERAL (rtype)) { int nbits = bitsForType (ltype); long v = (long) operandLitValue (right); diff --git a/src/SDCCicode.h b/src/SDCCicode.h index 12d31f03..5b6f3875 100644 --- a/src/SDCCicode.h +++ b/src/SDCCicode.h @@ -49,6 +49,7 @@ typedef enum OPTYPE; #define IS_SYMOP(op) (op && op->type == SYMBOL) +#define IS_VALOP(op) (op && op->type == VALUE) #define ADDTOCHAIN(x) addSetHead(&iCodeChain,x) #define LRFTYPE sym_link *ltype = operandType(left), \ -- 2.30.2