summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmDefinitions.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 115e30a..61328be 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -29,13 +29,14 @@ cmDefinitions::GetInternal(const std::string& key)
{
return i->second;
}
- if(cmDefinitions* up = this->Up)
+ cmDefinitions* up = this->Up;
+ if(!up)
{
- // Query the parent scope and store the result locally.
- Def def = up->GetInternal(key);
- return this->Map.insert(MapType::value_type(key, def)).first->second;
+ return this->NoDef;
}
- return this->NoDef;
+ // Query the parent scope and store the result locally.
+ Def def = up->GetInternal(key);
+ return this->Map.insert(MapType::value_type(key, def)).first->second;
}
//----------------------------------------------------------------------------