From 9a0cb50a08c24e2722e5b40e9ba4720dfd75afaf Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 21 Nov 2015 12:37:04 +0000 Subject: [PATCH] * converted the result of fullownerhierarchyname to tsymstr so it (and contcatenations based on it) can be longer than 255 characters in case tsymstr=ansistring git-svn-id: trunk@32412 - --- compiler/symdef.pas | 24 ++++++++++++++++++------ compiler/symtype.pas | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/compiler/symdef.pas b/compiler/symdef.pas index ace6a50e69..825d854c6c 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -64,7 +64,11 @@ interface tstoreddef = class(tdef) private +{$ifdef symansistr} + _fullownerhierarchyname : ansistring; +{$else symansistr} _fullownerhierarchyname : pshortstring; +{$endif symansistr} procedure writeentry(ppufile: tcompilerppufile; ibnr: byte); protected typesymderef : tderef; @@ -110,7 +114,7 @@ interface function needs_inittable : boolean;override; function rtti_mangledname(rt:trttitype):TSymStr;override; function OwnerHierarchyName: string; override; - function fullownerhierarchyname:string;override; + function fullownerhierarchyname:TSymStr;override; function needs_separate_initrtti:boolean;override; function in_currentunit: boolean; { regvars } @@ -1749,7 +1753,9 @@ implementation dispose(pderef(genericparaderefs[i])); genericparaderefs.free; genconstraintdata.free; +{$ifndef symansistr} stringdispose(_fullownerhierarchyname); +{$endif not symansistr} inherited destroy; end; @@ -1856,15 +1862,17 @@ implementation until tmp=nil; end; - function tstoreddef.fullownerhierarchyname: string; + function tstoreddef.fullownerhierarchyname: TSymStr; var tmp: tdef; begin +{$ifdef symansistr} + if _fullownerhierarchyname<>'' then + exit(_fullownerhierarchyname); +{$else symansistr} if assigned(_fullownerhierarchyname) then - begin - result:=_fullownerhierarchyname^; - exit; - end; + exit(_fullownerhierarchyname^); +{$endif symansistr} { the def can only reside inside structured types or procedures/functions/methods } tmp:=self; @@ -1883,7 +1891,11 @@ implementation if tmp.typ=procdef then result:=tprocdef(tmp).customprocname([pno_paranames,pno_proctypeoption])+'.'+result; until tmp=nil; +{$ifdef symansistr} + _fullownerhierarchyname:=result; +{$else symansistr} _fullownerhierarchyname:=stringdup(result); +{$endif symansistr} end; diff --git a/compiler/symtype.pas b/compiler/symtype.pas index 139dd7ae35..c46f7c3924 100644 --- a/compiler/symtype.pas +++ b/compiler/symtype.pas @@ -75,7 +75,7 @@ interface function getmangledparaname:TSymStr;virtual; function rtti_mangledname(rt:trttitype):TSymStr;virtual;abstract; function OwnerHierarchyName: string; virtual; abstract; - function fullownerhierarchyname:string;virtual;abstract; + function fullownerhierarchyname:TSymStr;virtual;abstract; function unique_id_str: string; function size:asizeint;virtual;abstract; function packedbitsize:asizeint;virtual;