Browse Source

* synchronize reg. variables before loading the function result

git-svn-id: trunk@2163 -
florian 19 years ago
parent
commit
a71d2b432c
1 changed files with 6 additions and 6 deletions
  1. 6 6
      compiler/psub.pas

+ 6 - 6
compiler/psub.pas

@@ -825,12 +825,6 @@ implementation
             free_regvars(aktproccode);
 {$endif OLDREGVARS}
 
-            { add code that will load the return value, this is not done
-              for assembler routines when they didn't reference the result
-              variable }
-            gen_load_return_value(templist);
-            aktproccode.concatlist(templist);
-
             { generate symbol and save end of header position }
             aktfilepos:=entrypos;
             gen_proc_symbol(templist);
@@ -844,6 +838,12 @@ implementation
             gen_free_symtable(aktproccode,procdef.localst);
             gen_free_symtable(aktproccode,procdef.parast);
 
+            { add code that will load the return value, this is not done
+              for assembler routines when they didn't reference the result
+              variable }
+            gen_load_return_value(templist);
+            aktproccode.concatlist(templist);
+
             { Already reserve all registers for stack checking code and
               generate the call to the helper function }
             if (cs_check_stack in entryswitches) and