From 71d866cd7ab8013f36ab5b01d849a74b9908aae0 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 30 Jun 2017 14:09:35 +0200 Subject: Abort early if there is nothing to encode or decode. --- libsolidity/codegen/CompilerUtils.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libsolidity/codegen/CompilerUtils.cpp') 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: // ... ... // The values dyn_head_i are added during the first loop and they point to the head part -- cgit