From 0189276a12c2784225e4d97baacb0a7bea6aac6c Mon Sep 17 00:00:00 2001 From: pierre Date: Sat, 5 Dec 2020 21:22:18 +0000 Subject: [PATCH] Raise internalerror inside RemoveCurentP is called with p=hp1, because it leads to using a class instance after it has been freed git-svn-id: trunk@47689 - --- compiler/aoptobj.pas | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/aoptobj.pas b/compiler/aoptobj.pas index 14253b1809..fd14f81674 100644 --- a/compiler/aoptobj.pas +++ b/compiler/aoptobj.pas @@ -1506,6 +1506,8 @@ Unit AoptObj; procedure TAOptObj.RemoveCurrentP(var p: tai; const hp1: tai); inline; begin + if (p=hp1) then + internalerror(2020120501); UpdateUsedRegs(tai(p.Next)); AsmL.Remove(p); p.Free;