소스 검색

* fixed invalid memory reads and potential double freeing when removing
superfluous temporary paralocs for llvm

git-svn-id: trunk@34955 -

Jonas Maebe 8 년 전
부모
커밋
280a6e15b7
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      compiler/llvm/llvmpara.pas

+ 3 - 3
compiler/llvm/llvmpara.pas

@@ -151,11 +151,11 @@ unit llvmpara;
               paraloc^.register:=hlcg.getaddressregister(list,paraloc^.def);
               paraloc^.shiftval:=0;
               { remove all other paralocs }
-              nextloc:=paraloc^.next;
-              while assigned(nextloc) do
+              while assigned(paraloc^.next) do
                 begin
-                  dispose(nextloc);
                   nextloc:=paraloc^.next;
+                  paraloc^.next:=nextloc^.next;
+                  dispose(nextloc);
                 end;
             end;
           paraloc^.llvmloc.loc:=paraloc^.loc;