aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-22 23:55:06 +0800
committerchriseth <chris@ethereum.org>2017-06-22 23:55:06 +0800
commit83ea7793d99ddc1f1c5bd897c3a2b5e457d2ce29 (patch)
tree5f3ef2b746016b36f0b8a3363518f8794c2f1d5d
parentf36e021ffc4aca746730b88195d492e3c73ceb62 (diff)
downloaddexon-solidity-83ea7793d99ddc1f1c5bd897c3a2b5e457d2ce29.tar
dexon-solidity-83ea7793d99ddc1f1c5bd897c3a2b5e457d2ce29.tar.gz
dexon-solidity-83ea7793d99ddc1f1c5bd897c3a2b5e457d2ce29.tar.bz2
dexon-solidity-83ea7793d99ddc1f1c5bd897c3a2b5e457d2ce29.tar.lz
dexon-solidity-83ea7793d99ddc1f1c5bd897c3a2b5e457d2ce29.tar.xz
dexon-solidity-83ea7793d99ddc1f1c5bd897c3a2b5e457d2ce29.tar.zst
dexon-solidity-83ea7793d99ddc1f1c5bd897c3a2b5e457d2ce29.zip
Fix ABI encoding of empty string literal.
-rw-r--r--Changelog.md1
-rw-r--r--libsolidity/codegen/CompilerUtils.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/Changelog.md b/Changelog.md
index 0fb2fe5c..e87cfa8e 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -15,6 +15,7 @@ Bugfixes:
* Type Checker: Make UTF8-validation a bit more sloppy to include more valid sequences.
* Fixed crash concerning non-callable types.
* Unused variable warnings no longer issued for variables used inside inline assembly.
+ * Code Generator: Fix ABI encoding of empty literal string.
* Inline Assembly: Enforce function arguments when parsing functional instructions.
### 0.4.11 (2017-05-03)
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp
index 3baaaddf..bfe72961 100644
--- a/libsolidity/codegen/CompilerUtils.cpp
+++ b/libsolidity/codegen/CompilerUtils.cpp
@@ -128,7 +128,7 @@ void CompilerUtils::storeInMemoryDynamic(Type const& _type, bool _padToWordBound
m_context << Instruction::DUP1;
storeStringData(bytesConstRef(str->value()));
if (_padToWordBoundaries)
- m_context << u256(((str->value().size() + 31) / 32) * 32);
+ m_context << u256(max<size_t>(32, ((str->value().size() + 31) / 32) * 32));
else
m_context << u256(str->value().size());
m_context << Instruction::ADD;