aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-03-31 07:18:09 +0800
committerchriseth <c@ethdev.com>2016-03-31 16:33:45 +0800
commit2c29492227553e3861089a0dc944b60fafcb7055 (patch)
treeb78ba5f6bc0d0381aaaf92edb8d032a61b4dbd1c /libsolidity/codegen
parent98b686c67207c2c3ced0110dced5ed6934716386 (diff)
downloaddexon-solidity-2c29492227553e3861089a0dc944b60fafcb7055.tar.gz
dexon-solidity-2c29492227553e3861089a0dc944b60fafcb7055.tar.zst
dexon-solidity-2c29492227553e3861089a0dc944b60fafcb7055.zip
Correctly clean higher order bits for index access.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 64eb6710..a17ec2f6 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -1069,6 +1069,7 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
solAssert(_indexAccess.indexExpression(), "Index expression expected.");
_indexAccess.indexExpression()->accept(*this);
+ utils().convertType(*_indexAccess.indexExpression()->annotation().type, IntegerType(256), true);
// stack layout: <base_ref> [<length>] <index>
ArrayUtils(m_context).accessIndex(arrayType);
switch (arrayType.location())
@@ -1104,6 +1105,7 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
solAssert(_indexAccess.indexExpression(), "Index expression expected.");
_indexAccess.indexExpression()->accept(*this);
+ utils().convertType(*_indexAccess.indexExpression()->annotation().type, IntegerType(256), true);
// stack layout: <value> <index>
// check out-of-bounds access
m_context << u256(fixedBytesType.numBytes());