summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-01-22 21:07:21 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-01-25 03:48:46 +0100
commitbe0dc7fbb8c0c1ead7eeeb9aefea6c081beeacdc (patch)
tree2c7a6fe40e6059478a4ea60a720195d569fd5318
parentb5124d9719ff5609832e02cd2b555966a6646b8f (diff)
QMake: replace a Q_ASSERT() with a Q_UNREACHABLE()
In release mode, the Q_ASSERT() is a no-op, and Clang rightfully pointed out that, in that case, the bool ok variable will be used uninitialized. Fix by using Q_UNREACHABLE(), which has an effect in both debug and release builds. Pick-to: 6.3 6.2 5.15 Change-Id: I33480aabe1c5233d1caddf9404f475ca9fcb8eaf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--qmake/library/qmakeparser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp
index 52e4187dbb..a4671bc692 100644
--- a/qmake/library/qmakeparser.cpp
+++ b/qmake/library/qmakeparser.cpp
@@ -1549,7 +1549,8 @@ static bool getBlock(const ushort *tokens, int limit, int &offset, QString *outS
ok = getSubBlock(tokens, limit, offset, outStr, indent, "block");
break;
default:
- Q_ASSERT(!"unhandled token");
+ // unhandled token
+ Q_UNREACHABLE();
}
}
if (!ok)