* flush pending local switch changes before evaluating ifopt

(mantis #10350)

git-svn-id: trunk@9413 -
This commit is contained in:
Jonas Maebe 2007-12-07 18:24:57 +00:00
parent 742ff35c48
commit 24f8249f36
3 changed files with 21 additions and 0 deletions

1
.gitattributes vendored
View File

@ -7799,6 +7799,7 @@ tests/webtbs/tw10210.pp svneol=native#text/plain
tests/webtbs/tw10224.pp svneol=native#text/plain
tests/webtbs/tw1023.pp svneol=native#text/plain
tests/webtbs/tw10320.pp svneol=native#text/plain
tests/webtbs/tw10350.pp svneol=native#text/plain
tests/webtbs/tw10371.pp svneol=native#text/plain
tests/webtbs/tw1041.pp svneol=native#text/plain
tests/webtbs/tw1044.pp svneol=native#text/plain

View File

@ -487,6 +487,11 @@ implementation
procedure dir_ifopt;
begin
if localswitcheschanged then
begin
current_settings.localswitches:=nextlocalswitches;
localswitcheschanged:=false;
end;
current_scanner.ifpreprocstack(pp_ifopt,@opt_check,scan_c_ifopt_found);
end;

15
tests/webtbs/tw10350.pp Normal file
View File

@ -0,0 +1,15 @@
{ %norun }
program TestLocal;
var i: longint;
begin
{$R+}
{$ifopt R+}
{$define local_RangeCheck}
{$R-}
{$endif}
i:= longword( -1);
{$ifdef local_RangeCheck}
{$R+}
{$endif}
end.