summaryrefslogtreecommitdiffstats
path: root/src/jomlib/ppexpr.l
diff options
context:
space:
mode:
authorJoerg Bornemann <[email protected]>2024-02-02 09:54:08 +0100
committerJoerg Bornemann <[email protected]>2024-02-02 10:53:26 +0000
commit5b295dbee66504d21b8cc7d05d5e88e87644d586 (patch)
treecd3745a3b7e4ac8d558af2a22ade4c0ab9551800 /src/jomlib/ppexpr.l
parent1878664e9a4ee146297fd55290e673b235ab1b29 (diff)
Fix compound defined() preprocessor expressionHEADmaster
Expressions like !if defined(foo) && defined(bar) checked for the existence of the macro "foo) && defined(bar" due to an overly greedy regular expression in the lexer of the preprocessor. NMake macro names cannot contain parentheses, so we can change the regex to not eat the closing parenthesis. The lexer was regenerated with flex 2.6.4. Fixes: QTCREATORBUG-24134 Change-Id: I0e5f4f5b5603cf1d2a53ad6ff9224e18e5649a7d Reviewed-by: Marcus Tillmanns <[email protected]>
Diffstat (limited to 'src/jomlib/ppexpr.l')
-rw-r--r--src/jomlib/ppexpr.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jomlib/ppexpr.l b/src/jomlib/ppexpr.l
index 87738d0..670c683 100644
--- a/src/jomlib/ppexpr.l
+++ b/src/jomlib/ppexpr.l
@@ -96,7 +96,7 @@ static int yywrap()
<STATE_DEFINED>{
[:blank:]+ /* eat whitespace */
- "(".+")" {
+ "("[^\)]+")" {
BEGIN(INITIAL);
QByteArray macroName(yytext);
int idx = macroName.indexOf('(');