mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Guard encoding crashes with assertions.
This commit is contained in:
parent
b5d941d3d9
commit
4134834ff3
@ -39,6 +39,7 @@ Bugfixes:
|
||||
* JSON AST: nodes were added at wrong parent
|
||||
* Why3 translator: crash fix for exponentiation
|
||||
* Type Checker: Fallback function cannot return data anymore.
|
||||
* Code Generator: Fix crash when sha3() was used on unsupported types.
|
||||
|
||||
Lots of changes to the documentation mainly by voluntary external contributors.
|
||||
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user