mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Respect memory model in forwarding revert inside catch.
This commit is contained in:
parent
996f3d31d5
commit
d721bbe504
@ -3093,7 +3093,7 @@ void IRGeneratorForStatements::handleCatch(TryStatement const& _tryStatement)
|
||||
if (_tryStatement.fallbackClause())
|
||||
handleCatchFallback(*_tryStatement.fallbackClause());
|
||||
else
|
||||
rethrow();
|
||||
m_code << m_utils.forwardingRevertFunction() << "()\n";
|
||||
m_code << "}\n";
|
||||
}
|
||||
|
||||
@ -3115,17 +3115,6 @@ void IRGeneratorForStatements::handleCatchFallback(TryCatchClause const& _fallba
|
||||
_fallback.accept(*this);
|
||||
}
|
||||
|
||||
void IRGeneratorForStatements::rethrow()
|
||||
{
|
||||
if (m_context.evmVersion().supportsReturndata())
|
||||
m_code << R"(
|
||||
returndatacopy(0, 0, returndatasize())
|
||||
revert(0, returndatasize())
|
||||
)"s;
|
||||
else
|
||||
m_code << "revert(0, 0) // rethrow\n"s;
|
||||
}
|
||||
|
||||
void IRGeneratorForStatements::revertWithError(
|
||||
string const& _signature,
|
||||
vector<Type const*> const& _parameterTypes,
|
||||
|
@ -103,9 +103,6 @@ private:
|
||||
void handleCatch(TryStatement const& _tryStatement);
|
||||
void handleCatchFallback(TryCatchClause const& _fallback);
|
||||
|
||||
/// Generates code to rethrow an exception.
|
||||
void rethrow();
|
||||
|
||||
/// Generates code to revert with an error. The error arguments are assumed to
|
||||
/// be already evaluated and available in local IRVariables, but not yet
|
||||
/// converted.
|
||||
|
Loading…
Reference in New Issue
Block a user