Merge pull request #7020 from ethereum/smt_fix_callstack_message

[SMTChecker] Fix wrong assertion in callstack message
This commit is contained in:
chriseth 2019-07-02 13:47:49 +02:00 committed by GitHub
commit ca10b59b25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -1264,8 +1264,6 @@ SecondarySourceLocation SMTEncoder::callStackMessage(vector<CallStackEntry> cons
for (auto const& call: _callStack | boost::adaptors::reversed)
if (call.second)
callStackLocation.append("", call.second->location());
// The first function in the tx has no FunctionCall.
solAssert(_callStack.front().second == nullptr, "");
return callStackLocation;
}

View File

@ -0,0 +1,13 @@
pragma experimental SMTChecker;
contract C {
uint x = f(2);
function f(uint y) internal pure returns (uint) {
assert(y > 1000);
return y;
}
}
// ----
// Warning: (116-132): Assertion violation happens here
// Warning: (116-132): Assertion violation happens here