mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11433 from ethereum/panic-dedup
Insert a call to panic function in legacy codegen (and not inline it every single time)
This commit is contained in:
@@ -334,14 +334,7 @@ CompilerContext& CompilerContext::appendJump(evmasm::AssemblyItem::JumpType _jum
|
||||
|
||||
CompilerContext& CompilerContext::appendPanic(util::PanicCode _code)
|
||||
{
|
||||
Whiskers templ(R"({
|
||||
mstore(0, <selector>)
|
||||
mstore(4, <code>)
|
||||
revert(0, 0x24)
|
||||
})");
|
||||
templ("selector", util::selectorFromSignature("Panic(uint256)").str());
|
||||
templ("code", toCompactHexWithPrefix(static_cast<unsigned>(_code)));
|
||||
appendInlineAssembly(templ.render());
|
||||
callYulFunction(utilFunctions().panicFunction(_code), 0, 0);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user