From 2c29492227553e3861089a0dc944b60fafcb7055 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 31 Mar 2016 01:18:09 +0200 Subject: Correctly clean higher order bits for index access. --- libsolidity/codegen/ExpressionCompiler.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libsolidity/codegen/ExpressionCompiler.cpp') 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: [] 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: // check out-of-bounds access m_context << u256(fixedBytesType.numBytes()); -- cgit