Don <> changed:

           What    |Removed                     |Added
                 CC|                            |
           Severity|normal                      |major

--- Comment #5 from Don <> 2010-09-18 11:43:17 PDT ---
(In reply to comment #3)
> "It's illegal to shift by more bits than the size of the quantity being
> shifted:
> int c;
> c << 33;    // error"
> However, there's a real problem with that spec: what if the number of bits to
> shift by isn't known at compile time?

That may be solvable with range propagation. Make it an error if it's not known
to be less than 32. It'd be painful to completely implement that rule right
now, but perhaps not later on when range propagation becomes more capable. We
could at least make it an error if the range of the expression doesn't include
ANY values in the legal range, and that would cover this test case.
I suspect that shifts by runtime-determined numbers of bits are relatively rare
-- and my experience is that they're quite bug-prone.

Raising priority to major, since this is a nasty trap.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to