mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Avoid switch fallthrough in CompilerUtils
This commit is contained in:
parent
ccb689701e
commit
3e5d81578a
@ -810,9 +810,8 @@ void CompilerUtils::convertType(
|
|||||||
if (_cleanupNeeded)
|
if (_cleanupNeeded)
|
||||||
m_context << Instruction::ISZERO << Instruction::ISZERO;
|
m_context << Instruction::ISZERO << Instruction::ISZERO;
|
||||||
break;
|
break;
|
||||||
case Type::Category::Function:
|
default:
|
||||||
{
|
if (stackTypeCategory == Type::Category::Function && targetTypeCategory == Type::Category::Integer)
|
||||||
if (targetTypeCategory == Type::Category::Integer)
|
|
||||||
{
|
{
|
||||||
IntegerType const& targetType = dynamic_cast<IntegerType const&>(_targetType);
|
IntegerType const& targetType = dynamic_cast<IntegerType const&>(_targetType);
|
||||||
solAssert(targetType.isAddress(), "Function type can only be converted to address.");
|
solAssert(targetType.isAddress(), "Function type can only be converted to address.");
|
||||||
@ -823,9 +822,7 @@ void CompilerUtils::convertType(
|
|||||||
m_context << Instruction::POP;
|
m_context << Instruction::POP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// fall-through
|
|
||||||
default:
|
|
||||||
// All other types should not be convertible to non-equal types.
|
// All other types should not be convertible to non-equal types.
|
||||||
solAssert(_typeOnStack == _targetType, "Invalid type conversion requested.");
|
solAssert(_typeOnStack == _targetType, "Invalid type conversion requested.");
|
||||||
if (_cleanupNeeded && _targetType.canBeStored() && _targetType.storageBytes() < 32)
|
if (_cleanupNeeded && _targetType.canBeStored() && _targetType.storageBytes() < 32)
|
||||||
|
Loading…
Reference in New Issue
Block a user