mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Correctly clean higher order bits for index access.
This commit is contained in:
parent
98b686c672
commit
2c29492227
@ -1069,6 +1069,7 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
|
|||||||
solAssert(_indexAccess.indexExpression(), "Index expression expected.");
|
solAssert(_indexAccess.indexExpression(), "Index expression expected.");
|
||||||
|
|
||||||
_indexAccess.indexExpression()->accept(*this);
|
_indexAccess.indexExpression()->accept(*this);
|
||||||
|
utils().convertType(*_indexAccess.indexExpression()->annotation().type, IntegerType(256), true);
|
||||||
// stack layout: <base_ref> [<length>] <index>
|
// stack layout: <base_ref> [<length>] <index>
|
||||||
ArrayUtils(m_context).accessIndex(arrayType);
|
ArrayUtils(m_context).accessIndex(arrayType);
|
||||||
switch (arrayType.location())
|
switch (arrayType.location())
|
||||||
@ -1104,6 +1105,7 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
|
|||||||
solAssert(_indexAccess.indexExpression(), "Index expression expected.");
|
solAssert(_indexAccess.indexExpression(), "Index expression expected.");
|
||||||
|
|
||||||
_indexAccess.indexExpression()->accept(*this);
|
_indexAccess.indexExpression()->accept(*this);
|
||||||
|
utils().convertType(*_indexAccess.indexExpression()->annotation().type, IntegerType(256), true);
|
||||||
// stack layout: <value> <index>
|
// stack layout: <value> <index>
|
||||||
// check out-of-bounds access
|
// check out-of-bounds access
|
||||||
m_context << u256(fixedBytesType.numBytes());
|
m_context << u256(fixedBytesType.numBytes());
|
||||||
|
Loading…
Reference in New Issue
Block a user