* simplify type conversions of ordinal constants to currency

git-svn-id: trunk@44055 -
This commit is contained in:
florian 2020-01-28 21:19:05 +00:00
parent 45ffa40b71
commit 6a1c09bb43

View File

@ -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;