Sfoglia il codice sorgente

* don't create the nestedvars struct for pure assembler routines, as
those will never call a nested routine using Pascal-level support
for accessing local variables (even if the nestedvars stayed empty,
this caused a stack frame to be allocated because a temp of 0
bytes is rounded up to 4 bytes)

git-svn-id: trunk@32739 -

Jonas Maebe 9 anni fa
parent
commit
5a8c151a72
1 ha cambiato i file con 8 aggiunte e 5 eliminazioni
  1. 8 5
      compiler/symcreat.pas

+ 8 - 5
compiler/symcreat.pas

@@ -1166,13 +1166,16 @@ implementation
       symtablestack.free;
       symtablestack:=old_symtablestack.getcopyuntil(pd.localst);
       pnestedvarsdef:=cpointerdef.getreusable(nestedvarsdef);
-      nestedvars:=clocalvarsym.create('$nestedvars',vs_var,nestedvarsdef,[],true);
-      pd.localst.insert(nestedvars);
-      pd.parentfpstruct:=nestedvars;
+      if not(po_assembler in pd.procoptions) then
+        begin
+          nestedvars:=clocalvarsym.create('$nestedvars',vs_var,nestedvarsdef,[],true);
+          pd.localst.insert(nestedvars);
+          pd.parentfpstruct:=nestedvars;
+          pd.parentfpinitblock:=cblocknode.create(nil);
+        end;
+      symtablestack.free;
       pd.parentfpstructptrtype:=pnestedvarsdef;
 
-      pd.parentfpinitblock:=cblocknode.create(nil);
-      symtablestack.free;
       symtablestack:=old_symtablestack;
     end;