mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 13:29:27 +02:00
* 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:
parent
9fc390877e
commit
44b325ec3e
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user