aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-03-06 06:44:08 +0800
committerchriseth <c@ethdev.com>2015-03-06 06:44:08 +0800
commit34e8de749aeecbca5f5dae817aa67f42907e9bf7 (patch)
treead08347d6d8c58d38b784f834e7a51dedc10bffb /AST.cpp
parente32bf97e87621bbb1de9623482c84d448e9884ac (diff)
parent280df42463c61786dd2dac0106d3f23c1b3c4275 (diff)
downloaddexon-solidity-34e8de749aeecbca5f5dae817aa67f42907e9bf7.tar
dexon-solidity-34e8de749aeecbca5f5dae817aa67f42907e9bf7.tar.gz
dexon-solidity-34e8de749aeecbca5f5dae817aa67f42907e9bf7.tar.bz2
dexon-solidity-34e8de749aeecbca5f5dae817aa67f42907e9bf7.tar.lz
dexon-solidity-34e8de749aeecbca5f5dae817aa67f42907e9bf7.tar.xz
dexon-solidity-34e8de749aeecbca5f5dae817aa67f42907e9bf7.tar.zst
dexon-solidity-34e8de749aeecbca5f5dae817aa67f42907e9bf7.zip
Merge pull request #1212 from chriseth/sol_arrayIndexOnCalldata
Index access for calldata and byte arrays.
Diffstat (limited to 'AST.cpp')
-rw-r--r--AST.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/AST.cpp b/AST.cpp
index aba35576..3a0aed11 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -671,8 +671,11 @@ void IndexAccess::checkTypeRequirements()
if (!m_index)
BOOST_THROW_EXCEPTION(createTypeError("Index expression cannot be omitted."));
m_index->expectType(IntegerType(256));
- m_type = type.getBaseType();
- m_isLValue = true;
+ if (type.isByteArray())
+ m_type = make_shared<IntegerType>(8, IntegerType::Modifier::Hash);
+ else
+ m_type = type.getBaseType();
+ m_isLValue = type.getLocation() != ArrayType::Location::CallData;
break;
}
case Type::Category::Mapping: