From 4bc1486cd3bfe4eba9c0fb169a87f431596a7959 Mon Sep 17 00:00:00 2001 From: vvs31415 Date: Fri, 4 Sep 2020 13:39:27 -0400 Subject: cmConditionEvaluator: Avoid comparing pointers --- Source/cmConditionEvaluator.cxx | 7 ++++--- 1 file 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; -- cgit v0.12