Skip to content
Snippets Groups Projects
Commit 4bc1486c authored by vvs31415's avatar vvs31415
Browse files

cmConditionEvaluator: Avoid comparing pointers

parent 6ff33a20
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment