mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 13:29:27 +02:00
* tmoddivnode.pass_typecheck: in the case of unsigned div/mod positive_const, check also the upper bound of the const, so it doesn't get truncated
git-svn-id: branches/i8086@24247 -
This commit is contained in:
parent
fef3732884
commit
1312fd72f2
@ -245,7 +245,8 @@ implementation
|
||||
{ (webtbs/tw8870) }
|
||||
if (rd.ordtype in [u8bit,u16bit,u32bit,u64bit]) and
|
||||
((is_constintnode(left) and
|
||||
(tordconstnode(left).value >= 0)) or
|
||||
(tordconstnode(left).value >= 0) and
|
||||
(tordconstnode(left).value <= get_max_value(rd))) or
|
||||
(not is_signed(ld) and
|
||||
(rd.size >= ld.size))) then
|
||||
begin
|
||||
@ -254,7 +255,8 @@ implementation
|
||||
end;
|
||||
if (ld.ordtype in [u8bit,u16bit,u32bit,u64bit]) and
|
||||
((is_constintnode(right) and
|
||||
(tordconstnode(right).value >= 0)) or
|
||||
(tordconstnode(right).value >= 0) and
|
||||
(tordconstnode(right).value <= get_max_value(ld))) or
|
||||
(not is_signed(rd) and
|
||||
(ld.size >= rd.size))) then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user