* 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 -
This commit is contained in:
pierre 2020-12-07 16:35:46 +00:00
parent 9fc390877e
commit 44b325ec3e

View File

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