Don't link items after we've encountered a compiler error.

Fixes #3930
This commit is contained in:
Gunnar Beutner 2013-04-08 10:09:27 +02:00
parent 23b75fd30d
commit ada9f634dd
2 changed files with 7 additions and 4 deletions

View File

@ -72,11 +72,11 @@ static bool LoadConfigFiles(bool validateOnly)
} }
} }
context.LinkItems(); /* Don't link or validate if we have already encountered at least one error. */
if (!hasError) {
/* Don't validate if we have already encountered at least one error. */ context.LinkItems();
if (!hasError)
context.ValidateItems(); context.ValidateItems();
}
hasError = false; hasError = false;

View File

@ -34,6 +34,9 @@ ConfigCompilerContext::ConfigCompilerContext(void)
void ConfigCompilerContext::AddItem(const ConfigItem::Ptr& item) void ConfigCompilerContext::AddItem(const ConfigItem::Ptr& item)
{ {
Log(LogDebug, "config", "Adding item to compiler context: type=" +
item->GetType() + "; name=" + item->GetName());
m_Items.push_back(item); m_Items.push_back(item);
m_ItemsMap[std::make_pair(item->GetType(), item->GetName())] = item; m_ItemsMap[std::make_pair(item->GetType(), item->GetName())] = item;
} }