diff options
author | chriseth <c@ethdev.com> | 2016-09-02 01:31:17 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-09-02 02:07:14 +0800 |
commit | 4134834ff3adedcf31d73edf5d25bfdc57994289 (patch) | |
tree | 4ce9bb7fc654321005214846ef8442218aaf7580 /libsolidity | |
parent | b5d941d3d9f32193c7f9094dee20511585508f6a (diff) | |
download | dexon-solidity-4134834ff3adedcf31d73edf5d25bfdc57994289.tar dexon-solidity-4134834ff3adedcf31d73edf5d25bfdc57994289.tar.gz dexon-solidity-4134834ff3adedcf31d73edf5d25bfdc57994289.tar.bz2 dexon-solidity-4134834ff3adedcf31d73edf5d25bfdc57994289.tar.lz dexon-solidity-4134834ff3adedcf31d73edf5d25bfdc57994289.tar.xz dexon-solidity-4134834ff3adedcf31d73edf5d25bfdc57994289.tar.zst dexon-solidity-4134834ff3adedcf31d73edf5d25bfdc57994289.zip |
Guard encoding crashes with assertions.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/codegen/CompilerUtils.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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: // <v1> <v2> ... <vn> <mem_start> <dyn_head_1> ... <dyn_head_r> <end_of_mem> |