mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 02:49:21 +02:00
+ fold also divisons involving pointer constants (those nodes are internally generated only)
This commit is contained in:
parent
2e9556f2eb
commit
48eeaf00a4
@ -215,10 +215,30 @@ implementation
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if is_constintnode(left) then
|
{ pointer subtractions generate nodes dividing pointer (constants) }
|
||||||
|
if is_constintnode(left) or is_constpointernode(left) then
|
||||||
begin
|
begin
|
||||||
rv:=tordconstnode(right).value;
|
{ load values }
|
||||||
lv:=tordconstnode(left).value;
|
case left.nodetype of
|
||||||
|
ordconstn:
|
||||||
|
lv:=tordconstnode(left).value;
|
||||||
|
pointerconstn:
|
||||||
|
lv:=tpointerconstnode(left).value;
|
||||||
|
niln:
|
||||||
|
lv:=0;
|
||||||
|
else
|
||||||
|
internalerror(2024041501);
|
||||||
|
end;
|
||||||
|
case right.nodetype of
|
||||||
|
ordconstn:
|
||||||
|
rv:=tordconstnode(right).value;
|
||||||
|
pointerconstn:
|
||||||
|
rv:=tpointerconstnode(right).value;
|
||||||
|
niln:
|
||||||
|
rv:=0;
|
||||||
|
else
|
||||||
|
internalerror(2024041502);
|
||||||
|
end;
|
||||||
|
|
||||||
case nodetype of
|
case nodetype of
|
||||||
modn:
|
modn:
|
||||||
|
Loading…
Reference in New Issue
Block a user