mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 20:29:17 +02:00
Avoidd to use hp1 after calling RemoveInstruction, as the VMT is invalidated
This commit is contained in:
parent
cfc77315ca
commit
71df6b83c6
@ -5942,13 +5942,13 @@ unit aoptx86;
|
|||||||
{ Overflow; abort }
|
{ Overflow; abort }
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
RemoveInstruction(hp1);
|
|
||||||
if (ThisConst = 0) then
|
if (ThisConst = 0) then
|
||||||
begin
|
begin
|
||||||
DebugMsg(SPeepholeOptimization + 'Arithmetic combine: ' +
|
DebugMsg(SPeepholeOptimization + 'Arithmetic combine: ' +
|
||||||
debug_op2str(taicpu(hp1).opcode) + ' $' + debug_tostr(taicpu(hp1).oper[0]^.val) + ',' + debug_operstr(taicpu(hp1).oper[1]^) + '; ' +
|
debug_op2str(taicpu(hp1).opcode) + ' $' + debug_tostr(taicpu(hp1).oper[0]^.val) + ',' + debug_operstr(taicpu(hp1).oper[1]^) + '; ' +
|
||||||
debug_op2str(taicpu(p).opcode) + ' $' + debug_tostr(taicpu(p).oper[0]^.val) + ',' + debug_operstr(taicpu(p).oper[1]^) + ' cancel out (NOP)', p);
|
debug_op2str(taicpu(p).opcode) + ' $' + debug_tostr(taicpu(p).oper[0]^.val) + ',' + debug_operstr(taicpu(p).oper[1]^) + ' cancel out (NOP)', p);
|
||||||
|
|
||||||
|
RemoveInstruction(hp1);
|
||||||
hp1 := tai(p.next);
|
hp1 := tai(p.next);
|
||||||
RemoveInstruction(p); { Note, the choice to not use RemoveCurrentp is deliberate }
|
RemoveInstruction(p); { Note, the choice to not use RemoveCurrentp is deliberate }
|
||||||
if not GetLastInstruction(hp1, p) then
|
if not GetLastInstruction(hp1, p) then
|
||||||
@ -5967,6 +5967,7 @@ unit aoptx86;
|
|||||||
debug_op2str(taicpu(p).opcode) + ' $' + debug_tostr(taicpu(p).oper[0]^.val) + ',' + debug_operstr(taicpu(p).oper[1]^) + ' -> ' +
|
debug_op2str(taicpu(p).opcode) + ' $' + debug_tostr(taicpu(p).oper[0]^.val) + ',' + debug_operstr(taicpu(p).oper[1]^) + ' -> ' +
|
||||||
debug_op2str(taicpu(p).opcode) + ' $' + debug_tostr(ThisConst) + ' ' + debug_operstr(taicpu(p).oper[1]^), p);
|
debug_op2str(taicpu(p).opcode) + ' $' + debug_tostr(ThisConst) + ' ' + debug_operstr(taicpu(p).oper[1]^), p);
|
||||||
|
|
||||||
|
RemoveInstruction(hp1);
|
||||||
taicpu(p).loadconst(0, ThisConst);
|
taicpu(p).loadconst(0, ThisConst);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user