Browse Source

* fixed crash with default parameters and stdcall calling convention

florian 23 years ago
parent
commit
4bbd4814c8
1 changed files with 13 additions and 5 deletions
  1. 13 5
      compiler/symtable.pas

+ 13 - 5
compiler/symtable.pas

@@ -1294,12 +1294,17 @@ implementation
         dataalignment:=_alignment;
         dataalignment:=_alignment;
         sym:=tvarsym(symindex.first);
         sym:=tvarsym(symindex.first);
         datasize:=0;
         datasize:=0;
-        { there can be only varsyms }
+        { there can be only varsyms      }
+        { no, default parameters         }
+        { lead to constsyms as well (FK) }
         while assigned(sym) do
         while assigned(sym) do
           begin
           begin
-             l:=sym.getpushsize;
-             sym.address:=datasize;
-             datasize:=align(datasize+l,dataalignment);
+             if sym.typ=varsym then
+               begin
+                  l:=sym.getpushsize;
+                  sym.address:=datasize;
+                  datasize:=align(datasize+l,dataalignment);
+               end;
              sym:=tvarsym(sym.indexnext);
              sym:=tvarsym(sym.indexnext);
           end;
           end;
       end;
       end;
@@ -2060,7 +2065,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.62  2002-07-01 18:46:28  peter
+  Revision 1.63  2002-07-15 19:44:53  florian
+    * fixed crash with default parameters and stdcall calling convention
+
+  Revision 1.62  2002/07/01 18:46:28  peter
     * internal linker
     * internal linker
     * reorganized aasm layer
     * reorganized aasm layer