mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Avoid switch fallthrough in ExpressionCompiler
This commit is contained in:
parent
3e5d81578a
commit
74972f5fa6
@ -1014,8 +1014,11 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
|
|||||||
switch (_memberAccess.expression().annotation().type->category())
|
switch (_memberAccess.expression().annotation().type->category())
|
||||||
{
|
{
|
||||||
case Type::Category::Contract:
|
case Type::Category::Contract:
|
||||||
|
case Type::Category::Integer:
|
||||||
{
|
{
|
||||||
bool alsoSearchInteger = false;
|
bool alsoSearchInteger = false;
|
||||||
|
if (_memberAccess.expression().annotation().type->category() == Type::Category::Contract)
|
||||||
|
{
|
||||||
ContractType const& type = dynamic_cast<ContractType const&>(*_memberAccess.expression().annotation().type);
|
ContractType const& type = dynamic_cast<ContractType const&>(*_memberAccess.expression().annotation().type);
|
||||||
if (type.isSuper())
|
if (type.isSuper())
|
||||||
{
|
{
|
||||||
@ -1044,11 +1047,13 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
|
|||||||
// not found in contract, search in members inherited from address
|
// not found in contract, search in members inherited from address
|
||||||
alsoSearchInteger = true;
|
alsoSearchInteger = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
alsoSearchInteger = true;
|
||||||
|
|
||||||
if (!alsoSearchInteger)
|
if (!alsoSearchInteger)
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
// fall-through
|
|
||||||
case Type::Category::Integer:
|
|
||||||
if (member == "balance")
|
if (member == "balance")
|
||||||
{
|
{
|
||||||
utils().convertType(
|
utils().convertType(
|
||||||
@ -1067,6 +1072,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
|
|||||||
else
|
else
|
||||||
solAssert(false, "Invalid member access to integer");
|
solAssert(false, "Invalid member access to integer");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case Type::Category::Function:
|
case Type::Category::Function:
|
||||||
if (member == "selector")
|
if (member == "selector")
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user