diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-01 03:37:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-01 03:37:47 +0800 |
commit | 4ca3b07e42ba6bb45c290aed7b6087c57f2cb242 (patch) | |
tree | 8f7e5aa1eb57a4ea47615a72ca561c13ba8c89c1 /libsolidity/codegen/CompilerUtils.cpp | |
parent | 568e7520768cb4612d24f3d12958ce353c4053dd (diff) | |
parent | 71d866cd7ab8013f36ab5b01d849a74b9908aae0 (diff) | |
download | dexon-solidity-4ca3b07e42ba6bb45c290aed7b6087c57f2cb242.tar dexon-solidity-4ca3b07e42ba6bb45c290aed7b6087c57f2cb242.tar.gz dexon-solidity-4ca3b07e42ba6bb45c290aed7b6087c57f2cb242.tar.bz2 dexon-solidity-4ca3b07e42ba6bb45c290aed7b6087c57f2cb242.tar.lz dexon-solidity-4ca3b07e42ba6bb45c290aed7b6087c57f2cb242.tar.xz dexon-solidity-4ca3b07e42ba6bb45c290aed7b6087c57f2cb242.tar.zst dexon-solidity-4ca3b07e42ba6bb45c290aed7b6087c57f2cb242.zip |
Merge pull request #2490 from ethereum/smallJumpOptimization
Abort early if there is nothing to encode or decode.
Diffstat (limited to 'libsolidity/codegen/CompilerUtils.cpp')
-rw-r--r-- | libsolidity/codegen/CompilerUtils.cpp | 3 |
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 |