Runtime Range check error 201 unexpected in INC procedure
Original Reporter info from Mantis: Voldemar0
-
Reporter name: Voldemar
Original Reporter info from Mantis: Voldemar0
- Reporter name: Voldemar
Description:
Hello !
I am not assured that it is an error, but it seems to me it is strange:
var
b: byte;
s: shortint;
begin
b:=57;
s:=-1;
inc(b, s);
end.
Free Pascal Compiler version 2.2.4 [2009/04/02] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: FreeBSD/ELF for i386
Compiling i.pp
Linking i
7 lines compiled, 0.1 sec
At start program:
Runtime error 201 at $0804815B
$0804815B main, line 7 of i.pp
$080480E9
But I expect b = 56. If change "inc(b, s)" to "b := b + s" - program right work.
Steps to reproduce:
Simply compile and start the program
Mantis conversion info:
- Mantis ID: 14841
- OS: FreeBSD
- OS Build: 7.0
- Build: 2009/04/02
- Platform: i386
- Version: 2.2.4
- Fixed in version: 2.4.2
- Fixed in revision: 15185 (#7cce96aa)
- Target version: 2.4.2