]> andersk Git - splint.git/blobdiff - src/cppexp.c
Fixed problem with assertion checking for negative shifts in
[splint.git] / src / cppexp.c
index 60f16b015340d9a2c167b41b2b7cd68ee65c1371..2cdc8a50a8bb6657b4363b65d797c939d11b8bcc 100644 (file)
@@ -809,13 +809,14 @@ left_shift (cppReader *pfile, long a, bool unsignedp, unsigned long b)
     }
   else
     {
-      long l = int_toNonNegative (a) << b;
+      /*@-shiftimplementation@*/
+      long l = a << b; /* int_toNonNegative removed (allow shifts of negative values) */ 
 
 # ifdef WIN32
 # pragma warning( disable : 4018 )
 # endif
 
-      if (int_toNonNegative (l) >> b != a)
+      if (l >> b != a) /* int_toNonNegative removed (allow shifts of negative values) */ 
        {
          integer_overflow (pfile);
        }
@@ -832,7 +833,8 @@ right_shift (long a, bool unsignedp, unsigned long b)
   else if (unsignedp)
     return (unsigned long) a >> b;
   else
-    return int_toNonNegative (a) >> b;
+    return a >> b; /* int_toNonNegative removed (allow shifts of negative values) */ 
+  /*@=shiftimplementation@*/
 }
 
 /* These priorities are all even, so we can handle associatively.  */
This page took 0.036514 seconds and 4 git commands to generate.