Ver Fonte

* resultname changed to pshortstring

git-svn-id: trunk@5295 -
peter há 19 anos atrás
pai
commit
13f359aa80
2 ficheiros alterados com 8 adições e 5 exclusões
  1. 7 4
      compiler/pdecsub.pas
  2. 1 1
      compiler/symdef.pas

+ 7 - 4
compiler/pdecsub.pas

@@ -200,6 +200,7 @@ implementation
         vs       : tlocalvarsym;
         aliasvs  : tabsolutevarsym;
         sl       : tpropaccesslist;
+        hs       : string;
       begin
         { The result from constructors and destructors can't be accessed directly }
         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,
              we can't use realname because that will not work for compilerprocs
              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.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);
            tlocalsymtable(pd.localst).insert(aliasvs);
 
@@ -1051,7 +1054,7 @@ implementation
                     end
                   else
                     begin
-                      pd.resultname:=orgpattern;
+                      pd.resultname:=stringdup(orgpattern);
                       consume(_ID);
                     end;
                   if not try_to_consume(_COLON) then

+ 1 - 1
compiler/symdef.pas

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