summaryrefslogtreecommitdiffstats
path: root/Source/cmConditionEvaluator.cxx
diff options
context:
space:
mode:
authorvvs31415 <vvs31415@users.noreply.github.com>2020-09-04 17:39:27 (GMT)
committervvs31415 <vvs31415@users.noreply.github.com>2020-09-04 17:39:27 (GMT)
commit4bc1486cd3bfe4eba9c0fb169a87f431596a7959 (patch)
treef46e9fc9750516e6d1ff94878e0c5d865d09df2f /Source/cmConditionEvaluator.cxx
parent6ff33a2011f418a053e9b3fec70681695838d606 (diff)
downloadCMake-4bc1486cd3bfe4eba9c0fb169a87f431596a7959.zip
CMake-4bc1486cd3bfe4eba9c0fb169a87f431596a7959.tar.gz
CMake-4bc1486cd3bfe4eba9c0fb169a87f431596a7959.tar.bz2
cmConditionEvaluator: Avoid comparing pointers
Diffstat (limited to 'Source/cmConditionEvaluator.cxx')
-rw-r--r--Source/cmConditionEvaluator.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index daa9f4c..8021b49 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -535,9 +535,10 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
this->IncrementArguments(newArgs, argP1, argP2);
if (argP1 != newArgs.end() && argP2 != newArgs.end() &&
IsKeyword(keyMATCHES, *argP1)) {
- def = this->GetVariableOrString(*arg);
- if (def != arg->c_str() // yes, we compare the pointer value
- && cmHasLiteralPrefix(arg->GetValue(), "CMAKE_MATCH_")) {
+ def = this->GetDefinitionIfUnquoted(*arg);
+ if (!def) {
+ def = arg->c_str();
+ } else if (cmHasLiteralPrefix(arg->GetValue(), "CMAKE_MATCH_")) {
// The string to match is owned by our match result variables.
// Move it to our own buffer before clearing them.
def_buf = def;