aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-09-27 21:56:17 +0800
committerchriseth <chris@ethereum.org>2017-09-27 21:57:39 +0800
commit2940964044331a87cbc3573fdb80fda8f0b4e976 (patch)
tree4aa44b4447e65f3cdf8f661d65d448078f5546c1 /libsolidity/codegen
parent3f783c8dad7a143d364f75ddac839aac2eeece1a (diff)
downloaddexon-solidity-2940964044331a87cbc3573fdb80fda8f0b4e976.tar.gz
dexon-solidity-2940964044331a87cbc3573fdb80fda8f0b4e976.tar.zst
dexon-solidity-2940964044331a87cbc3573fdb80fda8f0b4e976.zip
ABI encoder fixes and test.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/ABIFunctions.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/libsolidity/codegen/ABIFunctions.cpp b/libsolidity/codegen/ABIFunctions.cpp
index 22b620e1..202a747f 100644
--- a/libsolidity/codegen/ABIFunctions.cpp
+++ b/libsolidity/codegen/ABIFunctions.cpp
@@ -538,7 +538,7 @@ string ABIFunctions::abiEncodingFunctionSimpleArray(
mstore(pos, sub(tail, headStart))
tail := <encodeToMemoryFun>(<arrayElementAccess>, tail)
srcPtr := <nextArrayElement>(srcPtr)
- pos := add(pos, <elementEncodedSize>)
+ pos := add(pos, 0x20)
}
pos := tail
<assignEnd>
@@ -832,7 +832,7 @@ string ABIFunctions::abiEncodingFunctionStruct(
}
memberTempl("encodingOffset", toCompactHexWithPrefix(encodingOffset));
encodingOffset += dynamicMember ? 0x20 : memberTypeTo->calldataEncodedSize();
- memberTempl("abiEncode", abiEncodingFunction(*memberTypeFrom, *memberTypeTo, _encodeAsLibraryTypes, false));
+ memberTempl("abiEncode", abiEncodingFunction(*memberTypeFrom, *memberTypeTo, _encodeAsLibraryTypes, true));
members.push_back({});
members.back()["encode"] = memberTempl.render();
@@ -1190,10 +1190,7 @@ size_t ABIFunctions::headSize(TypePointers const& _targetTypes)
if (t->isDynamicallyEncoded())
headSize += 0x20;
else
- {
- solAssert(t->calldataEncodedSize() > 0, "");
headSize += t->calldataEncodedSize();
- }
}
return headSize;