mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #7664 from ethereum/smt_fixed_bytes_index_access
Fix ICE in FixedBytes IndexAccess
This commit is contained in:
commit
78be93856b
@ -15,6 +15,7 @@ Bugfixes:
|
||||
* Type Checker: Disallow constructor of the same class to be used as modifier
|
||||
* Code Generator: Fixed a faulty assert that would wrongly trigger for array sizes exceeding unsigned integer
|
||||
* Type Checker: Treat magic variables as unknown identifiers in inline assembly
|
||||
* SMTChecker: Fix internal error when accessing indices of fixed bytes.
|
||||
|
||||
|
||||
|
||||
|
@ -766,6 +766,15 @@ void SMTEncoder::endVisit(IndexAccess const& _indexAccess)
|
||||
auto varDecl = identifierToVariable(*id);
|
||||
solAssert(varDecl, "");
|
||||
array = m_context.variable(*varDecl);
|
||||
|
||||
if (varDecl->type()->category() == Type::Category::FixedBytes)
|
||||
{
|
||||
m_errorReporter.warning(
|
||||
_indexAccess.location(),
|
||||
"Assertion checker does not yet support index accessing fixed bytes."
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (auto const& innerAccess = dynamic_cast<IndexAccess const*>(&_indexAccess.baseExpression()))
|
||||
{
|
||||
|
@ -0,0 +1,10 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
bytes20 x;
|
||||
function f(bytes16 b) public view {
|
||||
b[uint8(x[2])];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (116-120): Assertion checker does not yet support index accessing fixed bytes.
|
||||
// Warning: (108-122): Assertion checker does not yet support index accessing fixed bytes.
|
Loading…
Reference in New Issue
Block a user