[fpc-devel]RangeChecking & NOT operator

Jonas Maebe jonas at zeus.rug.ac.be
Wed Apr 10 15:54:08 CEST 2002


On woensdag, april 10, 2002, at 03:33 , Peter Beisel wrote:

> But the other logical operators (AND, OR, XOR ... ) don't have this 
> problem.
> No one of them causes a range check error when used on byte-variables 
> and
> range checking is active.

That's because they don't generate a value that's out of the byte range. 
If you do

b := b xor $5;

then the whole expression is still evaluated as a longint, but the 
result will lie in the range of a byte, so no range check error is 
generated (there is still range check code generated, but it doesn't 
fail).


Jonas





More information about the fpc-devel mailing list