mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Insert a call to panic function in legacy codegen (and not inline it every single time)
This commit is contained in:
parent
a3634934d1
commit
c436785686
@ -6,6 +6,8 @@ Language Features:
|
||||
|
||||
|
||||
Compiler Features:
|
||||
* Code Generator: Insert helper functions for panic codes instead of inlining unconditionally. This can reduce costs if many panics (checks) are inserted,
|
||||
but can increase costs where few panics are used.
|
||||
* EVM: Set the default EVM version to "Berlin".
|
||||
* SMTChecker: Function definitions can be annotated with the custom Natspec tag ``custom:smtchecker abstract-function-nondet`` to be abstracted by a nondeterministic value when called.
|
||||
* Standard JSON / combined JSON: New artifact "functionDebugData" that contains bytecode offsets of entry points of functions and potentially more information in the future.
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user