aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2016-09-06 00:09:32 +0800
committerGitHub <noreply@github.com>2016-09-06 00:09:32 +0800
commitbe6a5f44d7ac4d63eb249988eb8e467fb15f5af4 (patch)
tree5eaae098f2d48e88a0005bec9b9ce01cc7feaae5 /libsolidity/codegen
parent940c5a861291a97e53e92e79450c8fbb9a38b6f2 (diff)
parentbf3f45c948b8c30dffcf19cf4bb1fcf3a74d8252 (diff)
downloaddexon-solidity-be6a5f44d7ac4d63eb249988eb8e467fb15f5af4.tar.gz
dexon-solidity-be6a5f44d7ac4d63eb249988eb8e467fb15f5af4.tar.zst
dexon-solidity-be6a5f44d7ac4d63eb249988eb8e467fb15f5af4.zip
Merge pull request #993 from chriseth/fixshacrash
Guard encoding crashes with assertions.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/CompilerUtils.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp
index d7d17b8e..ec496df8 100644
--- a/libsolidity/codegen/CompilerUtils.cpp
+++ b/libsolidity/codegen/CompilerUtils.cpp
@@ -160,7 +160,15 @@ void CompilerUtils::encodeToMemory(
TypePointers targetTypes = _targetTypes.empty() ? _givenTypes : _targetTypes;
solAssert(targetTypes.size() == _givenTypes.size(), "");
for (TypePointer& t: targetTypes)
+ {
+ solAssert(
+ t->mobileType() &&
+ t->mobileType()->interfaceType(_encodeAsLibraryTypes) &&
+ t->mobileType()->interfaceType(_encodeAsLibraryTypes)->encodingType(),
+ "Encoding type \"" + t->toString() + "\" not yet implemented."
+ );
t = t->mobileType()->interfaceType(_encodeAsLibraryTypes)->encodingType();
+ }
// Stack during operation:
// <v1> <v2> ... <vn> <mem_start> <dyn_head_1> ... <dyn_head_r> <end_of_mem>