소스 검색

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 -
pierre 4 년 전
부모
커밋
0189276a12
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      compiler/aoptobj.pas

+ 2 - 0
compiler/aoptobj.pas

@@ -1506,6 +1506,8 @@ Unit AoptObj;
 
 
     procedure TAOptObj.RemoveCurrentP(var p: tai; const hp1: tai); inline;
     procedure TAOptObj.RemoveCurrentP(var p: tai; const hp1: tai); inline;
       begin
       begin
+        if (p=hp1) then
+          internalerror(2020120501);
         UpdateUsedRegs(tai(p.Next));
         UpdateUsedRegs(tai(p.Next));
         AsmL.Remove(p);
         AsmL.Remove(p);
         p.Free;
         p.Free;