]> git.gag.com Git - fw/sdcc/commitdiff
small fix for constant range check
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 31 Jul 2001 09:19:12 +0000 (09:19 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 31 Jul 2001 09:19:12 +0000 (09:19 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1115 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCicode.c

index ea4f48d5cab440e51eddf7a1b91bce73fdc8d5fd..44403c9f610f3176216d7b4c9165eb84aeea001c 100644 (file)
@@ -2394,7 +2394,7 @@ geniCodeLogic (operand * left, operand * right, int op)
       int nbits = bitsForType (ltype);
       long v = (long) operandLitValue (right);
 
-      if (v > ((LONG_LONG) 1 << nbits) && v > 0)
+      if (v >= ((LONG_LONG) 1 << nbits) && v > 0)
        werror (W_CONST_RANGE, " compare operation ");
     }
 
@@ -2490,7 +2490,7 @@ geniCodeAssign (operand * left, operand * right, int nosupdate)
       int nbits = bitsForType (ltype);
       long v = (long) operandLitValue (right);
 
-      if (v > ((LONG_LONG) 1 << nbits) && v > 0)
+      if (v >= ((LONG_LONG) 1 << nbits) && v > 0)
        werror (W_CONST_RANGE, " = operation");
     }