|
@@ -1491,11 +1491,13 @@ implementation
|
|
|
begin
|
|
|
result:=caddnode.create(muln,getcopy,cordconstnode.create(10000,resultdef,false));
|
|
|
include(result.flags,nf_is_currency);
|
|
|
+ include(taddnode(result).left.flags,nf_internal);
|
|
|
end
|
|
|
else if is_currency(left.resultdef) then
|
|
|
begin
|
|
|
result:=cmoddivnode.create(divn,getcopy,cordconstnode.create(10000,resultdef,false));
|
|
|
include(result.flags,nf_is_currency);
|
|
|
+ include(taddnode(result).left.flags,nf_internal);
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
@@ -2902,6 +2904,7 @@ implementation
|
|
|
function ttypeconvnode.simplify(forinline : boolean): tnode;
|
|
|
var
|
|
|
hp: tnode;
|
|
|
+ v: Tconstexprint;
|
|
|
{$ifndef CPUNO32BITOPS}
|
|
|
foundsint: boolean;
|
|
|
{$endif not CPUNO32BITOPS}
|
|
@@ -3088,6 +3091,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;
|
|
|
|