From 4134834ff3adedcf31d73edf5d25bfdc57994289 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 1 Sep 2016 19:31:17 +0200 Subject: Guard encoding crashes with assertions. --- libsolidity/codegen/CompilerUtils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libsolidity/codegen') diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp index d7d17b8e..c02a8126 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: // ... ... -- cgit