mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-19 12:38:19 +02:00
* simplify type conversions of ordinal constants to currency
git-svn-id: trunk@44055 -
This commit is contained in:
parent
45ffa40b71
commit
6a1c09bb43
@ -2947,6 +2947,7 @@ implementation
|
|||||||
function ttypeconvnode.simplify(forinline : boolean): tnode;
|
function ttypeconvnode.simplify(forinline : boolean): tnode;
|
||||||
var
|
var
|
||||||
hp: tnode;
|
hp: tnode;
|
||||||
|
v: Tconstexprint;
|
||||||
{$ifndef CPUNO32BITOPS}
|
{$ifndef CPUNO32BITOPS}
|
||||||
foundsint: boolean;
|
foundsint: boolean;
|
||||||
{$endif not CPUNO32BITOPS}
|
{$endif not CPUNO32BITOPS}
|
||||||
@ -3133,6 +3134,15 @@ implementation
|
|||||||
result:=left;
|
result:=left;
|
||||||
left:=nil;
|
left:=nil;
|
||||||
exit;
|
exit;
|
||||||
|
end
|
||||||
|
else if (convtype=tc_int_2_int) and
|
||||||
|
is_currency(resultdef) then
|
||||||
|
begin
|
||||||
|
v:=tordconstnode(left).value;
|
||||||
|
if not(nf_internal in flags) and not(is_currency(left.resultdef)) then
|
||||||
|
v:=v*10000;
|
||||||
|
result:=cordconstnode.create(v,resultdef,false);
|
||||||
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user