aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLianaHus <liana@ethdev.com>2015-09-10 16:20:16 +0800
committerLianaHus <liana@ethdev.com>2015-09-15 17:40:20 +0800
commit5291467a26342e746028b0b238df6b364d0b1065 (patch)
tree084a195ac27c7f2206233d3e95a8b63b444ab11c
parentdd3b0664c667896c983579f18559e1e45db550b1 (diff)
downloaddexon-solidity-5291467a26342e746028b0b238df6b364d0b1065.tar.gz
dexon-solidity-5291467a26342e746028b0b238df6b364d0b1065.tar.zst
dexon-solidity-5291467a26342e746028b0b238df6b364d0b1065.zip
removed unneccessary check from ExpresiionCompiler
-rw-r--r--libsolidity/ExpressionCompiler.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp
index 4e607afd..1b9f2150 100644
--- a/libsolidity/ExpressionCompiler.cpp
+++ b/libsolidity/ExpressionCompiler.cpp
@@ -821,7 +821,6 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
_indexAccess.baseExpression().accept(*this);
Type const& baseType = *_indexAccess.baseExpression().type();
- Type const& indexType = *_indexAccess.indexExpression()->type();
if (baseType.category() == Type::Category::Mapping)
{
@@ -863,21 +862,8 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
solAssert(_indexAccess.indexExpression(), "Index expression expected.");
_indexAccess.indexExpression()->accept(*this);
-
- // check for dynamically sized arrays should be done after memberAccess visit to have length
- if (
- (indexType.category() == Type::Category::IntegerConstant) &&
- ((arrayType.isDynamicallySized() && arrayType.length()) || !arrayType.isDynamicallySized())
- )
- {
- IntegerConstantType const& constant = dynamic_cast<IntegerConstantType const&>(indexType);
- if (arrayType.length() < constant.literalValue(nullptr))
- BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Out of bounds access."));
- }
-
// stack layout: <base_ref> [<length>] <index>
ArrayUtils(m_context).accessIndex(arrayType);
-
switch (arrayType.location())
{
case DataLocation::Storage: