mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-06 03:38:41 +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;
|
||||
var
|
||||
hp: tnode;
|
||||
v: Tconstexprint;
|
||||
{$ifndef CPUNO32BITOPS}
|
||||
foundsint: boolean;
|
||||
{$endif not CPUNO32BITOPS}
|
||||
@ -3133,6 +3134,15 @@ implementation
|
||||
result:=left;
|
||||
left:=nil;
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user