From 01584fa8d41cda0d4ed284a205f11f24bdb35d50 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 27 Dec 2018 13:49:32 +0000 Subject: [PATCH] codetools: fixed parsing $IFOpt if option is not defined git-svn-id: branches/fixes_2_0@59915 - --- components/codetools/linkscanner.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/codetools/linkscanner.pas b/components/codetools/linkscanner.pas index 200c7ce23f..0aa8030186 100644 --- a/components/codetools/linkscanner.pas +++ b/components/codetools/linkscanner.pas @@ -4198,6 +4198,7 @@ end; function TLinkScanner.IfOptDirective: boolean; // {$ifopt o+} or {$ifopt o-} var Option, c: char; + v: String; begin inc(IfLevel); if StoreDirectives then @@ -4212,7 +4213,8 @@ begin if (SrcPos<=SrcLen) then begin c:=Src[SrcPos]; if c in ['+','-'] then begin - if (c='-')<>(Values.Variables[CompilerSwitchesNames[Option]]='0') then + v:=Values.Variables[CompilerSwitchesNames[Option]]; + if (c='-')<>((v='0') or (v='')) then begin SkipTillEndifElse(lssdTillElse); exit;