Fix ICE on unique errors

This commit is contained in:
Leo Alt
2021-09-09 16:37:43 +02:00
parent 3e2e3d1baa
commit d91f75deb8
3 changed files with 28 additions and 7 deletions
+3 -7
View File
@@ -58,11 +58,7 @@ public:
void warning(ErrorId _error, std::string const& _description)
{
if (!seen(_error, {}, _description))
{
m_errorReporter.warning(_error, _description);
markAsSeen(_error, {}, _description);
}
m_errorReporter.warning(_error, _description);
}
bool seen(ErrorId _error, SourceLocation const& _location, std::string const& _description) const
@@ -77,8 +73,8 @@ public:
void markAsSeen(ErrorId _error, SourceLocation const& _location, std::string const& _description)
{
solAssert(!seen(_error, _location, _description), "");
m_seenErrors[{_error, _location}] = _description;
if (_location != SourceLocation{})
m_seenErrors[{_error, _location}] = _description;
}
ErrorList const& errors() const { return m_errorReporter.errors(); }