aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-07-05 23:06:37 +0800
committerGitHub <noreply@github.com>2018-07-05 23:06:37 +0800
commit2987e33e23bf8eb7283b9fd6f24eaa03c4771d7b (patch)
treeae54e3f28af4557ff73299f193bbab2966bac7bb /libsolidity
parent98c034772233a6fe4d8e66ed305dfa9be15c6d89 (diff)
parentc8ac8618324d8d167c79a926880b2b5ab853f7f3 (diff)
downloaddexon-solidity-2987e33e23bf8eb7283b9fd6f24eaa03c4771d7b.tar.gz
dexon-solidity-2987e33e23bf8eb7283b9fd6f24eaa03c4771d7b.tar.zst
dexon-solidity-2987e33e23bf8eb7283b9fd6f24eaa03c4771d7b.zip
Merge pull request #4424 from ethereum/fixBytesAlloc
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