Warn of object name exceeds 255 characters

This commit is contained in:
Yonas Habteab 2026-03-24 16:38:55 +01:00
parent 2e6d23701a
commit 5a4cfae182

View file

@ -96,6 +96,15 @@ ConfigItem::Ptr ConfigItemBuilder::Compile()
<< "Object name of type '" << m_Type->GetName() << "' contains leading/trailing whitespace.\n" << oss.str();
}
if (m_Name.GetLength() > 255) {
std::ostringstream oss;
ShowCodeLocation(oss, m_DebugInfo, false);
Log(LogWarning, "config")
<< "Object name of type '" << m_Type->GetName() << "' is too long (length: " << m_Name.GetLength()
<< ", max: 255).\n" << oss.str();
}
std::vector<std::unique_ptr<Expression> > exprs;
Array::Ptr templateArray = new Array({ m_Name });