Browse Source

* restore localswitch settings after the initialization and finalization code was generated

git-svn-id: trunk@43535 -
svenbarth 5 years ago
parent
commit
f13200d68b
1 changed files with 6 additions and 0 deletions
  1. 6 0
      compiler/psub.pas

+ 6 - 0
compiler/psub.pas

@@ -1472,6 +1472,7 @@ implementation
         oldmaxfpuregisters : longint;
         oldmaxfpuregisters : longint;
         oldfilepos : tfileposinfo;
         oldfilepos : tfileposinfo;
         old_current_structdef : tabstractrecorddef;
         old_current_structdef : tabstractrecorddef;
+        oldswitches : tlocalswitches;
         templist : TAsmList;
         templist : TAsmList;
         headertai : tai;
         headertai : tai;
         i : integer;
         i : integer;
@@ -1736,6 +1737,8 @@ implementation
             { The position of the loadpara_asmnode is now known }
             { The position of the loadpara_asmnode is now known }
             aktproccode.insertlistafter(loadpara_asmnode.currenttai,templist);
             aktproccode.insertlistafter(loadpara_asmnode.currenttai,templist);
 
 
+            oldswitches:=current_settings.localswitches;
+
             { first generate entry and initialize code with the correct
             { first generate entry and initialize code with the correct
               position and switches }
               position and switches }
             current_filepos:=entrypos;
             current_filepos:=entrypos;
@@ -1775,6 +1778,9 @@ implementation
             hlcg.gen_exit_code(templist);
             hlcg.gen_exit_code(templist);
             aktproccode.concatlist(templist);
             aktproccode.concatlist(templist);
 
 
+            { reset switches }
+            current_settings.localswitches:=oldswitches;
+
 {$ifdef OLDREGVARS}
 {$ifdef OLDREGVARS}
             { note: this must be done only after as much code as possible has  }
             { note: this must be done only after as much code as possible has  }
             {   been generated. The result is that when you ungetregister() a  }
             {   been generated. The result is that when you ungetregister() a  }