Browse Source

+ sub routines with children with asm blocks need a real stack frame, fixes new failure of tw0848

git-svn-id: trunk@2177 -
florian 19 years ago
parent
commit
1024b80867
1 changed files with 21 additions and 1 deletions
  1. 21 1
      compiler/psub.pas

+ 21 - 1
compiler/psub.pas

@@ -56,6 +56,7 @@ interface
         procedure parse_body;
         procedure parse_body;
 
 
         function stack_tainting_parameter : boolean;
         function stack_tainting_parameter : boolean;
+        function has_assembler_child : boolean;
       end;
       end;
 
 
 
 
@@ -629,6 +630,24 @@ implementation
       end;
       end;
 
 
 
 
+    function tcgprocinfo.has_assembler_child : boolean;
+      var
+        hp : tcgprocinfo;
+      begin
+        result:=false;
+        hp:=tcgprocinfo(nestedprocs.first);
+        while assigned(hp) do
+          begin
+            if (hp.flags*[pi_has_assembler_block,pi_is_assembler])<>[] then
+              begin
+                result:=true;
+                exit;
+              end;
+            hp:=tcgprocinfo(hp.next);
+          end;
+      end;
+
+
     procedure tcgprocinfo.generate_code;
     procedure tcgprocinfo.generate_code;
       var
       var
         oldprocinfo : tprocinfo;
         oldprocinfo : tprocinfo;
@@ -728,7 +747,8 @@ implementation
                    calling generate_parameter_info doesn't hurt but it costs time
                    calling generate_parameter_info doesn't hurt but it costs time
                  }
                  }
                  generate_parameter_info;
                  generate_parameter_info;
-                 if not(stack_tainting_parameter) then
+                 if not(stack_tainting_parameter) and
+                   not(has_assembler_child) then
                    begin
                    begin
                      { Only need to set the framepointer }
                      { Only need to set the framepointer }
                      framepointer:=NR_STACK_POINTER_REG;
                      framepointer:=NR_STACK_POINTER_REG;