فهرست منبع

* dir_push might not flush pending switch changes but has to read the pending
record if needed

git-svn-id: trunk@47660 -

florian 4 سال پیش
والد
کامیت
0b63068ad2
1فایلهای تغییر یافته به همراه33 افزوده شده و 9 حذف شده
  1. 33 9
      compiler/scandir.pas

+ 33 - 9
compiler/scandir.pas

@@ -1241,15 +1241,39 @@ unit scandir;
       if switchesstatestackpos > switchesstatestackmax then
         Message(scan_e_too_many_push);
 
-      flushpendingswitchesstate;
-
-      switchesstatestack[switchesstatestackpos].localsw:= current_settings.localswitches;
-      switchesstatestack[switchesstatestackpos].pmessage:= current_settings.pmessage;
-      switchesstatestack[switchesstatestackpos].verbosity:=status.verbosity;
-      switchesstatestack[switchesstatestackpos].alignment:=current_settings.alignment;
-      switchesstatestack[switchesstatestackpos].setalloc:=current_settings.setalloc;
-      switchesstatestack[switchesstatestackpos].packenum:=current_settings.packenum;
-      switchesstatestack[switchesstatestackpos].packrecords:=current_settings.packrecords;
+      { do not flush here as we might have read directives which shall not be active yet,
+        see e.g. tests/webtbs/tw22744b.pp }
+      if psf_alignment_changed in pendingstate.flags then
+        switchesstatestack[switchesstatestackpos].alignment:=pendingstate.nextalignment
+      else
+        switchesstatestack[switchesstatestackpos].alignment:=current_settings.alignment;
+
+      if psf_verbosity_full_switched in pendingstate.flags then
+        switchesstatestack[switchesstatestackpos].verbosity:=pendingstate.nextverbosityfullswitch
+      else
+        switchesstatestack[switchesstatestackpos].verbosity:=status.verbosity;
+
+      if psf_local_switches_changed in pendingstate.flags then
+        switchesstatestack[switchesstatestackpos].localsw:=pendingstate.nextlocalswitches
+      else
+        switchesstatestack[switchesstatestackpos].localsw:=current_settings.localswitches;
+
+      if psf_packenum_changed in pendingstate.flags then
+        switchesstatestack[switchesstatestackpos].packenum:=pendingstate.nextpackenum
+      else
+        switchesstatestack[switchesstatestackpos].packenum:=current_settings.packenum;
+
+      if psf_packrecords_changed in pendingstate.flags then
+        switchesstatestack[switchesstatestackpos].packrecords:=pendingstate.nextpackrecords
+      else
+        switchesstatestack[switchesstatestackpos].packrecords:=current_settings.packrecords;
+
+      if psf_setalloc_changed in pendingstate.flags then
+        switchesstatestack[switchesstatestackpos].setalloc:=pendingstate.nextsetalloc
+      else
+        switchesstatestack[switchesstatestackpos].setalloc:=current_settings.setalloc;
+
+      switchesstatestack[switchesstatestackpos].pmessage:=pendingstate.nextmessagerecord;
       Inc(switchesstatestackpos);
     end;