summaryrefslogtreecommitdiffstats
path: root/Source/cmConditionEvaluator.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-08-04 13:08:17 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2021-08-08 14:19:08 (GMT)
commite5cd39ca80c8c234118ded33a1576c1be281aa9e (patch)
tree0494dad04188959dd6cefc9497688718ff88006b /Source/cmConditionEvaluator.cxx
parent350065bb855a26692ed6af04870f144ae1f6a886 (diff)
downloadCMake-e5cd39ca80c8c234118ded33a1576c1be281aa9e.zip
CMake-e5cd39ca80c8c234118ded33a1576c1be281aa9e.tar.gz
CMake-e5cd39ca80c8c234118ded33a1576c1be281aa9e.tar.bz2
cmProp: refactoring: transform alias in class
To handle safely the values used by CMake variables and properties, introduce the class cmProp as a replacement from the simple pointer to std::string instance.
Diffstat (limited to 'Source/cmConditionEvaluator.cxx')
-rw-r--r--Source/cmConditionEvaluator.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index 415f667..49189d8 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -317,7 +317,7 @@ cmProp cmConditionEvaluator::GetVariableOrString(
cmProp def = this->GetDefinitionIfUnquoted(argument);
if (!def) {
- def = &argument.GetValue();
+ def = cmProp(argument.GetValue());
}
return def;
@@ -403,7 +403,7 @@ bool cmConditionEvaluator::GetBooleanValueOld(
// Old GetVariableOrNumber behavior.
cmProp def = this->GetDefinitionIfUnquoted(arg);
if (!def && std::atoi(arg.GetValue().c_str())) {
- def = &arg.GetValue();
+ def = cmProp(arg.GetValue());
}
return !cmIsOff(def);
}
@@ -649,13 +649,13 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
std::string def_buf;
if (!def) {
- def = &args.current->GetValue();
+ def = cmProp(args.current->GetValue());
} else if (cmHasLiteralPrefix(args.current->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;
- def = &def_buf;
+ def = cmProp(def_buf);
}
this->Makefile.ClearMatches();