aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libsolidity/codegen/ArrayUtils.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/codegen/ArrayUtils.cpp b/libsolidity/codegen/ArrayUtils.cpp
index 67ca22f1..e17188c2 100644
--- a/libsolidity/codegen/ArrayUtils.cpp
+++ b/libsolidity/codegen/ArrayUtils.cpp
@@ -913,10 +913,10 @@ void ArrayUtils::accessIndex(ArrayType const& _arrayType, bool _doBoundsCheck) c
switch (location)
{
case DataLocation::Memory:
- if (_arrayType.isDynamicallySized())
- m_context << u256(32) << Instruction::ADD;
- // fall-through
case DataLocation::CallData:
+ if (location == DataLocation::Memory && _arrayType.isDynamicallySized())
+ m_context << u256(32) << Instruction::ADD;
+
if (!_arrayType.isByteArray())
{
m_context << Instruction::SWAP1;