From 44b325ec3ef25ad04b17443b6b1fc42895a9d0be Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 7 Dec 2020 16:35:46 +0000 Subject: [PATCH] * 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 - --- compiler/aarch64/cpupara.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/aarch64/cpupara.pas b/compiler/aarch64/cpupara.pas index ff66b8caaf..d40f8f0fde 100644 --- a/compiler/aarch64/cpupara.pas +++ b/compiler/aarch64/cpupara.pas @@ -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 }