Ver código fonte

* proper tavrprocinfo.calc_stackframe_size

git-svn-id: trunk@30597 -
florian 10 anos atrás
pai
commit
e733efbbc2
1 arquivos alterados com 7 adições e 2 exclusões
  1. 7 2
      compiler/avr/cpupi.pas

+ 7 - 2
compiler/avr/cpupi.pas

@@ -66,8 +66,13 @@ unit cpupi;
 
     function tavrprocinfo.calc_stackframe_size:longint;
       begin
-        maxpushedparasize:=align(maxpushedparasize,max(current_settings.alignment.localalignmin,2));
-        result:=Align(tg.direction*tg.lasttemp,max(current_settings.alignment.localalignmin,2))+maxpushedparasize;
+        if tg.lasttemp=2 then
+          { correct that lasttemp is 2 in case of an empty stack due to the post-decrement pushing and an additional correction
+            in tgobj.setfirsttemp.
+          }
+          result:=maxpushedparasize
+        else
+          result:=tg.direction*tg.lasttemp+maxpushedparasize;
       end;