diff --git a/compiler/defutil.pas b/compiler/defutil.pas index db47490007..9f7dd87ffa 100644 --- a/compiler/defutil.pas +++ b/compiler/defutil.pas @@ -1047,7 +1047,7 @@ implementation floatdef: result:=tfloatdef(p).floattype in [s64currency,s64real,s32real]; stringdef: - result:=tstringdef(p).stringtype in [st_ansistring,st_widestring]; + result:=tstringdef(p).stringtype in [st_ansistring,st_widestring,st_unicodestring]; variantdef: result:=true; objectdef: diff --git a/compiler/ncal.pas b/compiler/ncal.pas index 2ed18366d9..d464bc6fc7 100644 --- a/compiler/ncal.pas +++ b/compiler/ncal.pas @@ -400,7 +400,7 @@ implementation { we've to know the parameter size to allocate the temp. space } is_byref_para(assignmenttype); - inc(paramssize, assignmenttype.size); + inc(paramssize,max(voidpointertype.size,assignmenttype.size)); para:=tcallparanode(para.nextpara); end; @@ -454,7 +454,7 @@ implementation restype:=restype or $80; { assign the argument/parameter to the temporary location } - { we always pass Variants by reference, RTL helpers must handle it + { for Variants, we always pass a pointer, RTL helpers must handle it depending on byref bit } if assignmenttype=voidpointertype then @@ -474,7 +474,7 @@ implementation )),assignmenttype), ctypeconvnode.create_internal(para.left,assignmenttype))); - inc(paramssize,assignmenttype.size); + inc(paramssize,max(voidpointertype.size,assignmenttype.size)); calldescnode.appendbyte(restype); para.left:=nil;