소스 검색

Add explicit zeroing of trttiparaloc record to avoid hash calculation issues

git-svn-id: trunk@49339 -
pierre 4 년 전
부모
커밋
0a4f75ce7a
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      compiler/paramgr.pas

+ 6 - 0
compiler/paramgr.pas

@@ -801,6 +801,12 @@ implementation
       var
         reg : tregisterrec;
       begin
+        { Explicitly zero the whole record, to avoid
+          trouble as this record is used as is in a
+          hash calculation, which might give unreliable
+          results if the record as gaps between fields
+          due to field alignment. PM 2021-05-06 }
+        fillchar(result,sizeof(trttiparaloc),#0);
         if paraloc^.Loc=LOC_REFERENCE then
           begin
             reg:=tregisterrec(paraloc^.reference.index);