a possible fix for bug #460662 part 2
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 15 Sep 2001 15:37:44 +0000 (15:37 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 15 Sep 2001 15:37:44 +0000 (15:37 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1272 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCicode.c
src/SDCCicode.h

index 919b9526267f06161ca4b4784cc2d0c6beaae5fd..2c99d04a33c50ccb4e8e99a3beda3cc0ba881e45 100644 (file)
@@ -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);
index 12d31f035b2877a2348e2433661208030dd451b0..5b6f38754342559ab31f1175cf5267d1a258a18d 100644 (file)
@@ -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), \