mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 20:29:14 +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) }
|
{ (webtbs/tw8870) }
|
||||||
if (rd.ordtype in [u8bit,u16bit,u32bit,u64bit]) and
|
if (rd.ordtype in [u8bit,u16bit,u32bit,u64bit]) and
|
||||||
((is_constintnode(left) 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
|
(not is_signed(ld) and
|
||||||
(rd.size >= ld.size))) then
|
(rd.size >= ld.size))) then
|
||||||
begin
|
begin
|
||||||
@ -254,7 +255,8 @@ implementation
|
|||||||
end;
|
end;
|
||||||
if (ld.ordtype in [u8bit,u16bit,u32bit,u64bit]) and
|
if (ld.ordtype in [u8bit,u16bit,u32bit,u64bit]) and
|
||||||
((is_constintnode(right) 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
|
(not is_signed(rd) and
|
||||||
(ld.size >= rd.size))) then
|
(ld.size >= rd.size))) then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user