aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/CompilerUtils.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-30 20:09:35 +0800
committerchriseth <chris@ethereum.org>2017-06-30 20:16:16 +0800
commit71d866cd7ab8013f36ab5b01d849a74b9908aae0 (patch)
tree40e6c1ca1439cd49403e731894ac89f0191d471c /libsolidity/codegen/CompilerUtils.cpp
parent735c977db1824436d09d8e7a5c120fcab21003c3 (diff)
downloaddexon-solidity-71d866cd7ab8013f36ab5b01d849a74b9908aae0.tar.gz
dexon-solidity-71d866cd7ab8013f36ab5b01d849a74b9908aae0.tar.zst
dexon-solidity-71d866cd7ab8013f36ab5b01d849a74b9908aae0.zip
Abort early if there is nothing to encode or decode.
Diffstat (limited to 'libsolidity/codegen/CompilerUtils.cpp')
-rw-r--r--libsolidity/codegen/CompilerUtils.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp
index 4edec155..a105036f 100644
--- a/libsolidity/codegen/CompilerUtils.cpp
+++ b/libsolidity/codegen/CompilerUtils.cpp
@@ -180,6 +180,9 @@ void CompilerUtils::encodeToMemory(
t = t->mobileType()->interfaceType(_encodeAsLibraryTypes)->encodingType();
}
+ if (_givenTypes.empty())
+ return;
+
// Stack during operation:
// <v1> <v2> ... <vn> <mem_start> <dyn_head_1> ... <dyn_head_r> <end_of_mem>
// The values dyn_head_i are added during the first loop and they point to the head part