소스 검색

* Initialize result out parameter by caling the constructor Init, not the method Reset.
This out parameter called 'result' is of type tcgpara, which is an object, but not a class,
it has no virtual method, which means that the VMT is never used, and thus the
fact that the object is not 'constructed' can be easily missed.
Nevertheless, it could generate problems as the different fields have unassigned
and thus random value, while reset method can dereference location field
if not nil.
Issue found by using -gttt compiler option.

git-svn-id: trunk@47711 -

pierre 4 년 전
부모
커밋
44b325ec3e
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      compiler/aarch64/cpupara.pas

+ 1 - 1
compiler/aarch64/cpupara.pas

@@ -349,7 +349,7 @@ unit cpupara;
         paracgsize, locsize: tcgsize;
         paracgsize, locsize: tcgsize;
         firstparaloc: boolean;
         firstparaloc: boolean;
       begin
       begin
-        result.reset;
+        result.init;
 
 
         { currently only support C-style array of const,
         { currently only support C-style array of const,
           there should be no location assigned to the vararg array itself }
           there should be no location assigned to the vararg array itself }