[Issue 1601] shr and shl error message is missing line numbers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 20 03:13:50 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1601


braddr at puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch




------- Comment #2 from braddr at puremagic.com  2007-10-20 05:13 -------
The fix (tested with gdc which exhibits exactly the same bug):

--- optimize.c  2007-10-20 03:11:39.000000000 -0700
+++ optimize.c.orig     2007-10-20 03:12:10.000000000 -0700
@@ -473,7 +473,7 @@
        integer_t i2 = e->e2->toInteger();
        d_uns64 sz = e->e1->type->size() * 8;
        if (i2 < 0 || i2 > sz)
-       {   e->error("shift by %jd is outside the range 0..%zu", i2, sz);
+       {   error("shift by %jd is outside the range 0..%zu", i2, sz);
            e->e2 = new IntegerExp(0);
        }
        if (e->e1->isConst() == 1)

The new ouput, with Matti's version of the code:
bug550.d:4: Error: shift assign by 33 is outside the range 0..32
bug550.d:5: Error: shift assign by 33 is outside the range 0..32
bug550.d:6: Error: shift assign by 33 is outside the range 0..32
bug550.d:7: Error: shift left by 33 exceeds 32
bug550.d:8: Error: shift left by 33 exceeds 32
bug550.d:9: Error: shift left by 33 exceeds 32


-- 



More information about the Digitalmars-d-bugs mailing list