mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix ICE in FixedBytes IndexAccess
This commit is contained in:
parent
ed7be7b9c7
commit
5dacaf57bc
@ -15,6 +15,7 @@ Bugfixes:
|
|||||||
* Type Checker: Disallow constructor of the same class to be used as modifier
|
* 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
|
* 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
|
* 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);
|
auto varDecl = identifierToVariable(*id);
|
||||||
solAssert(varDecl, "");
|
solAssert(varDecl, "");
|
||||||
array = m_context.variable(*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()))
|
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