ソースを参照

* fixed superfluous generation of stackframes for assembler procedures
with no local vars or para's (this broke the backtrace printing in case
of an rte)

Jonas Maebe 24 年 前
コミット
ca27b25d5e
1 ファイル変更14 行追加3 行削除
  1. 14 3
      compiler/pstatmnt.pas

+ 14 - 3
compiler/pstatmnt.pas

@@ -1183,8 +1183,6 @@ implementation
           if not is_void(aktprocsym.definition.rettype.def) then
           if not is_void(aktprocsym.definition.rettype.def) then
            begin
            begin
               aktprocsym.definition.funcretsym:=tfuncretsym.create(aktprocsym.name,aktprocsym.definition.rettype);
               aktprocsym.definition.funcretsym:=tfuncretsym.create(aktprocsym.name,aktprocsym.definition.rettype);
-              { insert in local symtable }
-              symtablestack.insert(aktprocsym.definition.funcretsym);
               if ret_in_acc(aktprocsym.definition.rettype.def) then
               if ret_in_acc(aktprocsym.definition.rettype.def) then
                 begin
                 begin
                    { in assembler code the result should be directly in %eax
                    { in assembler code the result should be directly in %eax
@@ -1227,6 +1225,14 @@ implementation
                dec(aktprocsym.definition.parast.address_fixup,target_info.size_of_pointer);
                dec(aktprocsym.definition.parast.address_fixup,target_info.size_of_pointer);
                dec(procinfo^.para_offset,target_info.size_of_pointer);
                dec(procinfo^.para_offset,target_info.size_of_pointer);
              end;
              end;
+          { only insert now in the symtable, otherwise the              }
+          { "aktprocsym.definition.localst.datasize=0" check above will }
+          { always fail (JM)                                            }
+          if not is_void(aktprocsym.definition.rettype.def) then
+            begin
+              { insert in local symtable }
+              symtablestack.insert(aktprocsym.definition.funcretsym);
+            end;
           { force the asm statement }
           { force the asm statement }
             if token<>_ASM then
             if token<>_ASM then
              consume(_ASM);
              consume(_ASM);
@@ -1240,7 +1246,12 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.35  2001-09-03 13:19:12  jonas
+  Revision 1.36  2001-09-06 10:21:50  jonas
+    * fixed superfluous generation of stackframes for assembler procedures
+      with no local vars or para's (this broke the backtrace printing in case
+      of an rte)
+
+  Revision 1.35  2001/09/03 13:19:12  jonas
     * set funcretsym for assembler procedures too (otherwise using __RESULT
     * set funcretsym for assembler procedures too (otherwise using __RESULT
       in assembler procedures causes a crash)
       in assembler procedures causes a crash)