mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix ICE when trying to decode too large static arrays
This commit is contained in:
parent
50b200a5d5
commit
884e7cbffc
@ -14,6 +14,7 @@ Bugfixes:
|
||||
* Optimizer: Fixed a bug in BlockDeDuplicator.
|
||||
* Type Checker: Disallow assignments to storage variables of type ``mapping``.
|
||||
* Type Checker: Fix internal compiler error when accessing members of array slices.
|
||||
* Type Checker: Fix internal compiler error when trying to decode too large static arrays.
|
||||
* NatSpec: DocString block is terminated when encountering an empty line.
|
||||
* Scanner: Fix bug when two empty NatSpec comments lead to scanning past EOL.
|
||||
* Code Generator: Trigger proper unimplemented errors on certain array copy operations.
|
||||
|
@ -193,6 +193,18 @@ TypePointers TypeChecker::typeCheckABIDecodeAndRetrieveReturnType(FunctionCall c
|
||||
typeArgument->location(),
|
||||
"Decoding type " + actualType->toString(false) + " not supported."
|
||||
);
|
||||
|
||||
if (auto referenceType = dynamic_cast<ReferenceType const*>(actualType))
|
||||
{
|
||||
auto result = referenceType->validForLocation(referenceType->location());
|
||||
if (!result)
|
||||
m_errorReporter.typeError(
|
||||
6118_error,
|
||||
typeArgument->location(),
|
||||
result.message()
|
||||
);
|
||||
}
|
||||
|
||||
components.push_back(actualType);
|
||||
}
|
||||
else
|
||||
|
@ -0,0 +1,8 @@
|
||||
// Used to cause ICE
|
||||
contract C {
|
||||
function f() public {
|
||||
abi.decode("", (byte[999999999]));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (75-90): Type too large for memory.
|
Loading…
Reference in New Issue
Block a user