mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix internal error when the abstract-nondet SMTChecker natspec annotation is used with a wrong option multiple times for the same function
This commit is contained in:
@@ -1102,14 +1102,18 @@ set<CHC::CHCNatspecOption> CHC::smtNatspecTags(FunctionDefinition const& _functi
|
||||
{
|
||||
set<CHC::CHCNatspecOption> options;
|
||||
string smtStr = "custom:smtchecker";
|
||||
bool errorSeen = false;
|
||||
for (auto const& [tag, value]: _function.annotation().docTags)
|
||||
if (tag == smtStr)
|
||||
{
|
||||
string const& content = value.content;
|
||||
if (auto option = natspecOptionFromString(content))
|
||||
options.insert(*option);
|
||||
else
|
||||
else if (!errorSeen)
|
||||
{
|
||||
errorSeen = true;
|
||||
m_errorReporter.warning(3130_error, _function.location(), "Unknown option for \"" + smtStr + "\": \"" + content + "\"");
|
||||
}
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user