Browse Source

* resultname changed to pshortstring

git-svn-id: trunk@5295 -
peter 18 years ago
parent
commit
13f359aa80
2 changed files with 8 additions and 5 deletions
  1. 7 4
      compiler/pdecsub.pas
  2. 1 1
      compiler/symdef.pas

+ 7 - 4
compiler/pdecsub.pas

@@ -200,6 +200,7 @@ implementation
         vs       : tlocalvarsym;
         vs       : tlocalvarsym;
         aliasvs  : tabsolutevarsym;
         aliasvs  : tabsolutevarsym;
         sl       : tpropaccesslist;
         sl       : tpropaccesslist;
+        hs       : string;
       begin
       begin
         { The result from constructors and destructors can't be accessed directly }
         { The result from constructors and destructors can't be accessed directly }
         if not(pd.proctypeoption in [potype_constructor,potype_destructor]) and
         if not(pd.proctypeoption in [potype_constructor,potype_destructor]) and
@@ -220,11 +221,13 @@ implementation
            { insert the name of the procedure as alias for the function result,
            { insert the name of the procedure as alias for the function result,
              we can't use realname because that will not work for compilerprocs
              we can't use realname because that will not work for compilerprocs
              as the name is lowercase and unreachable from the code }
              as the name is lowercase and unreachable from the code }
-           if pd.resultname='' then
-            pd.resultname:=pd.procsym.name;
+           if assigned(pd.resultname) then
+             hs:=pd.resultname^
+           else
+             hs:=pd.procsym.name;
            sl:=tpropaccesslist.create;
            sl:=tpropaccesslist.create;
            sl.addsym(sl_load,pd.funcretsym);
            sl.addsym(sl_load,pd.funcretsym);
-           aliasvs:=tabsolutevarsym.create_ref(pd.resultname,pd.returndef,sl);
+           aliasvs:=tabsolutevarsym.create_ref(hs,pd.returndef,sl);
            include(aliasvs.varoptions,vo_is_funcret);
            include(aliasvs.varoptions,vo_is_funcret);
            tlocalsymtable(pd.localst).insert(aliasvs);
            tlocalsymtable(pd.localst).insert(aliasvs);
 
 
@@ -1051,7 +1054,7 @@ implementation
                     end
                     end
                   else
                   else
                     begin
                     begin
-                      pd.resultname:=orgpattern;
+                      pd.resultname:=stringdup(orgpattern);
                       consume(_ID);
                       consume(_ID);
                     end;
                     end;
                   if not try_to_consume(_COLON) then
                   if not try_to_consume(_COLON) then

+ 1 - 1
compiler/symdef.pas

@@ -439,7 +439,7 @@ interface
           libsymderef : tderef;
           libsymderef : tderef;
 {$endif powerpc or m68k}
 {$endif powerpc or m68k}
           { name of the result variable to insert in the localsymtable }
           { name of the result variable to insert in the localsymtable }
-          resultname : TIDString;
+          resultname : pshortstring;
           { true, if the procedure is only declared
           { true, if the procedure is only declared
             (forward procedure) }
             (forward procedure) }
           forwarddef,
           forwarddef,