From 2d8873d0854df357c28def22214ba55d5f0ad2d9 Mon Sep 17 00:00:00 2001 From: yury Date: Tue, 28 Jul 2020 23:27:42 +0000 Subject: [PATCH] * Fixed TAOptObj.CollapseZeroDistJump to properly handle delay slots. git-svn-id: trunk@45874 - --- compiler/aoptobj.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/aoptobj.pas b/compiler/aoptobj.pas index 5cc11ac8ba..6886f44631 100644 --- a/compiler/aoptobj.pas +++ b/compiler/aoptobj.pas @@ -2163,8 +2163,8 @@ Unit AoptObj; tmp, hp1: tai; begin Result := False; - hp1 := tai(p.Next); - tmp := hp1; { Might be an align before the label, so keep a note of it } + if not GetNextInstruction(p,hp1) then + exit; if (hp1 = BlockEnd) then Exit; @@ -2178,6 +2178,7 @@ Unit AoptObj; {$ifdef cpudelayslot} RemoveDelaySlot(p); {$endif cpudelayslot} + tmp := tai(p.Next); { Might be an align before the label, so keep a note of it } asml.remove(p); p.free;