aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-07-04 17:23:51 +0800
committerchriseth <chris@ethereum.org>2018-07-05 20:18:14 +0800
commitc8ac8618324d8d167c79a926880b2b5ab853f7f3 (patch)
tree9aeba99e7ee74e34c91aae2792a8b2a291745e4e /libsolidity
parentb1ab81ef22030ee16c6d216bfe6a4dc74b726985 (diff)
downloaddexon-solidity-c8ac8618324d8d167c79a926880b2b5ab853f7f3.tar.gz
dexon-solidity-c8ac8618324d8d167c79a926880b2b5ab853f7f3.tar.zst
dexon-solidity-c8ac8618324d8d167c79a926880b2b5ab853f7f3.zip
Fix allocation of byte arrays.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/codegen/CompilerUtils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp
index a5e96335..2f45765a 100644
--- a/libsolidity/codegen/CompilerUtils.cpp
+++ b/libsolidity/codegen/CompilerUtils.cpp
@@ -510,7 +510,7 @@ void CompilerUtils::zeroInitialiseMemoryArray(ArrayType const& _type)
codecopy(memptr, codesize(), size)
memptr := add(memptr, size)
})");
- templ("element_size", to_string(_type.baseType()->memoryHeadSize()));
+ templ("element_size", to_string(_type.isByteArray() ? 1 : _type.baseType()->memoryHeadSize()));
m_context.appendInlineAssembly(templ.render(), {"length", "memptr"});
}
else