* fix for Mantis #27378: save and (more importantly) restore verbosity when switching a unit

+ added test

git-svn-id: trunk@40750 -
This commit is contained in:
svenbarth 2019-01-03 20:31:34 +00:00
parent 10ab893de3
commit 04bbfd1746
5 changed files with 45 additions and 1 deletions

3
.gitattributes vendored
View File

@ -14683,6 +14683,7 @@ tests/webtbf/tw26704.pp svneol=native#text/plain
tests/webtbf/tw2719.pp svneol=native#text/plain
tests/webtbf/tw2721.pp svneol=native#text/plain
tests/webtbf/tw2724.pp svneol=native#text/plain
tests/webtbf/tw27378.pp svneol=native#text/pascal
tests/webtbf/tw2739.pp svneol=native#text/plain
tests/webtbf/tw2751.pp svneol=native#text/plain
tests/webtbf/tw2752.pp svneol=native#text/plain
@ -14895,6 +14896,8 @@ tests/webtbf/uw0840b.pp svneol=native#text/plain
tests/webtbf/uw0856.pp svneol=native#text/plain
tests/webtbf/uw2414.pp svneol=native#text/plain
tests/webtbf/uw25283.pp svneol=native#text/plain
tests/webtbf/uw27378a.pp svneol=native#text/pascal
tests/webtbf/uw27378b.pp svneol=native#text/pascal
tests/webtbf/uw3450.pp svneol=native#text/plain
tests/webtbf/uw3969.pp svneol=native#text/plain
tests/webtbf/uw4103.pp svneol=native#text/plain

View File

@ -60,6 +60,7 @@ type
old_settings : tsettings;
old_switchesstatestack : tswitchesstatestack;
old_switchesstatestackpos : Integer;
old_verbosity : longint;
{ only saved/restored if "full" is true }
old_asmdata : tasmdata;
@ -74,7 +75,7 @@ procedure restore_global_state(const state:tglobalstate;full:boolean);
implementation
uses
pbase;
pbase,comphook;
procedure save_global_state(out state:tglobalstate;full:boolean);
begin
@ -106,6 +107,7 @@ uses
//flushpendingswitchesstate;
oldcurrent_filepos:=current_filepos;
old_settings:=current_settings;
old_verbosity:=status.verbosity;
if full then
begin
@ -142,6 +144,7 @@ uses
current_procinfo:=oldcurrent_procinfo;
current_filepos:=oldcurrent_filepos;
current_settings:=old_settings;
status.verbosity:=old_verbosity;
if full then
begin

14
tests/webtbf/tw27378.pp Normal file
View File

@ -0,0 +1,14 @@
{ %FAIL }
{ %OPT=-B -Sen }
{ we want the "Local variable "Var2" not used" hint as an error; if we don't
get the error then resetting the verbosity when switching the unit failed }
program tw27378;
uses
uw27378a, uw27378b;
begin
end.

13
tests/webtbf/uw27378a.pp Normal file
View File

@ -0,0 +1,13 @@
unit uw27378a;
interface
{$NOTES OFF}
implementation
var
Var1: Boolean;
end.

11
tests/webtbf/uw27378b.pp Normal file
View File

@ -0,0 +1,11 @@
unit uw27378b;
interface
implementation
var
Var2: Boolean;
end.