Browse Source

* reset the message state only inside flushpendingswitchesstate(), not during $POP itself

Sven/Sarah Barth 7 months ago
parent
commit
59be46a6fb
2 changed files with 4 additions and 2 deletions
  1. 1 2
      compiler/scandir.pas
  2. 3 0
      compiler/switches.pas

+ 1 - 2
compiler/scandir.pas

@@ -1264,8 +1264,7 @@ unit scandir;
           recordpendingpackrecords(switchesstatestack[switchesstatestackpos].packrecords);
           recordpendingsetalloc(switchesstatestack[switchesstatestackpos].setalloc);
           pendingstate.nextmessagerecord:=switchesstatestack[switchesstatestackpos].pmessage;
-          { Reset verbosity and forget previous pmeesage }
-          RestoreLocalVerbosity(nil);
+          { flushpendingswitchesstate will reset the message state }
           current_settings.pmessage:=nil;
           { Do not activate these changes yet, as otherwise
             you get a problem if you put a $pop just right after

+ 3 - 0
compiler/switches.pas

@@ -426,6 +426,9 @@ procedure flushpendingswitchesstate;
         pendingstate.nextverbositystr:='';
       end;
     msgset:=thashset.create(10,false,false);
+    { we need to start from a clean slate }
+    if not assigned(current_settings.pmessage) then
+      RestoreLocalVerbosity(nil);
     fstate:=pendingstate.nextmessagerecord;
     pstate:=pendingstate.nextmessagerecord;
     while assigned(pstate) do