mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12123 from ethereum/empty-switch-12068
CodeGen: Only output switch when it has cases
This commit is contained in:
@@ -967,7 +967,7 @@ string IRGenerator::callValueCheck()
|
||||
string IRGenerator::dispatchRoutine(ContractDefinition const& _contract)
|
||||
{
|
||||
Whiskers t(R"X(
|
||||
if iszero(lt(calldatasize(), 4))
|
||||
<?+cases>if iszero(lt(calldatasize(), 4))
|
||||
{
|
||||
let selector := <shr224>(calldataload(0))
|
||||
switch selector
|
||||
@@ -985,8 +985,8 @@ string IRGenerator::dispatchRoutine(ContractDefinition const& _contract)
|
||||
}
|
||||
</cases>
|
||||
default {}
|
||||
}
|
||||
if iszero(calldatasize()) { <receiveEther> }
|
||||
}</+cases>
|
||||
<?+receiveEther>if iszero(calldatasize()) { <receiveEther> }</+receiveEther>
|
||||
<fallback>
|
||||
)X");
|
||||
t("shr224", m_utils.shiftRightFunction(224));
|
||||
|
||||
Reference in New Issue
Block a user