aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-03-04 00:55:28 +0800
committerchriseth <c@ethdev.com>2015-03-05 20:19:59 +0800
commitb84cf62d6bd3a9caa8a9a7f1dcd427418170aed9 (patch)
treec775f78562d5775487ba8b884d0499023734a7db /AST.cpp
parenta4d772315d814408c057a9473c2c1fefa351a5b4 (diff)
downloaddexon-solidity-b84cf62d6bd3a9caa8a9a7f1dcd427418170aed9.tar.gz
dexon-solidity-b84cf62d6bd3a9caa8a9a7f1dcd427418170aed9.tar.zst
dexon-solidity-b84cf62d6bd3a9caa8a9a7f1dcd427418170aed9.zip
Index access for calldata 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: