mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix ICE on unique errors
This commit is contained in:
parent
3e2e3d1baa
commit
d91f75deb8
@ -57,12 +57,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void warning(ErrorId _error, std::string const& _description)
|
void warning(ErrorId _error, std::string const& _description)
|
||||||
{
|
|
||||||
if (!seen(_error, {}, _description))
|
|
||||||
{
|
{
|
||||||
m_errorReporter.warning(_error, _description);
|
m_errorReporter.warning(_error, _description);
|
||||||
markAsSeen(_error, {}, _description);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool seen(ErrorId _error, SourceLocation const& _location, std::string const& _description) const
|
bool seen(ErrorId _error, SourceLocation const& _location, std::string const& _description) const
|
||||||
@ -77,7 +73,7 @@ public:
|
|||||||
|
|
||||||
void markAsSeen(ErrorId _error, SourceLocation const& _location, std::string const& _description)
|
void markAsSeen(ErrorId _error, SourceLocation const& _location, std::string const& _description)
|
||||||
{
|
{
|
||||||
solAssert(!seen(_error, _location, _description), "");
|
if (_location != SourceLocation{})
|
||||||
m_seenErrors[{_error, _location}] = _description;
|
m_seenErrors[{_error, _location}] = _description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ SMTCheckerTest::SMTCheckerTest(string const& _filename): SyntaxTest(_filename, E
|
|||||||
else
|
else
|
||||||
BOOST_THROW_EXCEPTION(runtime_error("Invalid SMT \"show unproved\" choice."));
|
BOOST_THROW_EXCEPTION(runtime_error("Invalid SMT \"show unproved\" choice."));
|
||||||
|
|
||||||
|
m_modelCheckerSettings.solvers = smtutil::SMTSolverChoice::None();
|
||||||
auto const& choice = m_reader.stringSetting("SMTSolvers", "any");
|
auto const& choice = m_reader.stringSetting("SMTSolvers", "any");
|
||||||
if (choice == "any")
|
if (choice == "any")
|
||||||
m_modelCheckerSettings.solvers = smtutil::SMTSolverChoice::All();
|
m_modelCheckerSettings.solvers = smtutil::SMTSolverChoice::All();
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
==== Source: a.sol ====
|
||||||
|
contract A {
|
||||||
|
uint x;
|
||||||
|
}
|
||||||
|
==== Source: b.sol ====
|
||||||
|
import "a.sol";
|
||||||
|
contract B is A {
|
||||||
|
function g() public view { assert(x > x); }
|
||||||
|
}
|
||||||
|
==== Source: c.sol ====
|
||||||
|
import "b.sol";
|
||||||
|
contract C is B {
|
||||||
|
function h(uint x) public pure { assert(x < x); }
|
||||||
|
}
|
||||||
|
// ====
|
||||||
|
// SMTEngine: all
|
||||||
|
// SMTSolvers: smtlib2
|
||||||
|
// ----
|
||||||
|
// Warning 6328: (b.sol:62-75): CHC: Assertion violation might happen here.
|
||||||
|
// Warning 3996: CHC analysis was not possible. No Horn solver was available. None of the installed solvers was enabled.
|
||||||
|
// Warning 7812: (b.sol:62-75): BMC: Assertion violation might happen here.
|
||||||
|
// Warning 8084: BMC analysis was not possible. No SMT solver (Z3 or CVC4) was available. None of the installed solvers was enabled.
|
||||||
|
// Warning 6328: (c.sol:68-81): CHC: Assertion violation might happen here.
|
||||||
|
// Warning 7812: (c.sol:68-81): BMC: Assertion violation might happen here.
|
Loading…
Reference in New Issue
Block a user