From 8b21bf1cce2fcf5e62c10a08f0ddd25dfdb6b33b Mon Sep 17 00:00:00 2001 From: svenbarth Date: Sat, 5 Jun 2021 17:43:49 +0000 Subject: [PATCH] * fix writing of the method and parameter names for the Variant call description git-svn-id: trunk@49479 - (cherry picked from commit 7330a0156c3c154343d143b038fc3a3ec0996602) --- compiler/ncal.pas | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/compiler/ncal.pas b/compiler/ncal.pas index 46950ef104..8d9de8a9b6 100644 --- a/compiler/ncal.pas +++ b/compiler/ncal.pas @@ -509,7 +509,7 @@ implementation { build up parameters and description } para:=tcallparanode(parametersnode); paramssize:=0; - names := #0; + names := ''; while assigned(para) do begin { Skipped parameters are actually (varType=varError, vError=DISP_E_PARAMNOTFOUND). @@ -573,12 +573,11 @@ implementation if variantdispatch then begin - { length-1, because the following names variable *always* starts - with #0 which will be the terminator for methodname } - tcb.emit_pchar_const(pchar(methodname),length(methodname)-1,true); - { length-1 because we added a null terminator to the string itself - already } - tcb.emit_pchar_const(pchar(names),length(names)-1,true); + tcb.emit_pchar_const(pchar(methodname),length(methodname),true); + if names<>'' then + { length-1 because we added a null terminator to the string itself + already } + tcb.emit_pchar_const(pchar(names),length(names)-1,true); end; { may be referred from other units in case of inlining -> global