mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2820 from ethereum/fallthrough
Fix some other fallthrough cases
This commit is contained in:
commit
9e90ddcae5
@ -913,10 +913,10 @@ void ArrayUtils::accessIndex(ArrayType const& _arrayType, bool _doBoundsCheck) c
|
|||||||
switch (location)
|
switch (location)
|
||||||
{
|
{
|
||||||
case DataLocation::Memory:
|
case DataLocation::Memory:
|
||||||
if (_arrayType.isDynamicallySized())
|
|
||||||
m_context << u256(32) << Instruction::ADD;
|
|
||||||
// fall-through
|
|
||||||
case DataLocation::CallData:
|
case DataLocation::CallData:
|
||||||
|
if (location == DataLocation::Memory && _arrayType.isDynamicallySized())
|
||||||
|
m_context << u256(32) << Instruction::ADD;
|
||||||
|
|
||||||
if (!_arrayType.isByteArray())
|
if (!_arrayType.isByteArray())
|
||||||
{
|
{
|
||||||
m_context << Instruction::SWAP1;
|
m_context << Instruction::SWAP1;
|
||||||
|
@ -829,6 +829,7 @@ void CompilerUtils::convertType(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// fall-through
|
||||||
default:
|
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.");
|
||||||
|
@ -1047,6 +1047,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
|
|||||||
if (!alsoSearchInteger)
|
if (!alsoSearchInteger)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// fall-through
|
||||||
case Type::Category::Integer:
|
case Type::Category::Integer:
|
||||||
if (member == "balance")
|
if (member == "balance")
|
||||||
{
|
{
|
||||||
|
@ -1263,15 +1263,15 @@ ASTPointer<Expression> Parser::parseLeftHandSideExpression(
|
|||||||
nodeFactory.markEndPosition();
|
nodeFactory.markEndPosition();
|
||||||
expectToken(Token::RBrack);
|
expectToken(Token::RBrack);
|
||||||
expression = nodeFactory.createNode<IndexAccess>(expression, index);
|
expression = nodeFactory.createNode<IndexAccess>(expression, index);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case Token::Period:
|
case Token::Period:
|
||||||
{
|
{
|
||||||
m_scanner->next();
|
m_scanner->next();
|
||||||
nodeFactory.markEndPosition();
|
nodeFactory.markEndPosition();
|
||||||
expression = nodeFactory.createNode<MemberAccess>(expression, expectIdentifierToken());
|
expression = nodeFactory.createNode<MemberAccess>(expression, expectIdentifierToken());
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case Token::LParen:
|
case Token::LParen:
|
||||||
{
|
{
|
||||||
m_scanner->next();
|
m_scanner->next();
|
||||||
@ -1281,8 +1281,8 @@ ASTPointer<Expression> Parser::parseLeftHandSideExpression(
|
|||||||
nodeFactory.markEndPosition();
|
nodeFactory.markEndPosition();
|
||||||
expectToken(Token::RParen);
|
expectToken(Token::RParen);
|
||||||
expression = nodeFactory.createNode<FunctionCall>(expression, arguments, names);
|
expression = nodeFactory.createNode<FunctionCall>(expression, arguments, names);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return expression;
|
return expression;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user