* try_make_mul32to64: restore original node order if transformation failed

o this gets called by taddnode.pass_1, which caches the left/right
   node types/resultdefs

git-svn-id: trunk@47158 -
This commit is contained in:
Jonas Maebe 2020-10-23 13:34:24 +00:00
parent 51d6622148
commit 0729340817

View File

@ -3569,12 +3569,16 @@ implementation
var
temp: tnode;
leftoriginallysigned,
canbesignedconst, canbeunsignedconst: boolean;
canbesignedconst, canbeunsignedconst, swapped: boolean;
begin
result := false;
swapped := false;
{ make sure that if there is a constant, that it's on the right }
if left.nodetype = ordconstn then
swapleftright;
begin
swapleftright;
swapped := true;
end;
if is_32to64typeconv(left) then
begin
leftoriginallysigned:=is_signed(ttypeconvnode(left).left.resultdef);
@ -3613,6 +3617,10 @@ implementation
result := true;
end;
end;
{ pass_Typecheck caches left/right type and resultdef, so restore the
original order }
if not result and swapped then
swapleftright;
end;