diff options
author | chriseth <chris@ethereum.org> | 2017-08-26 01:37:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-26 01:37:59 +0800 |
commit | 9e90ddcae5dd7fb6eb70e49f978979979cf39985 (patch) | |
tree | 81be45d85b534a81fab6aa35520e2f589cd0adef | |
parent | 6475bd9a72526011b495fae45aa6c8ddb514f611 (diff) | |
parent | da56bde58f6099b199a109f528045953a5fe1bab (diff) | |
download | dexon-solidity-9e90ddcae5dd7fb6eb70e49f978979979cf39985.tar dexon-solidity-9e90ddcae5dd7fb6eb70e49f978979979cf39985.tar.gz dexon-solidity-9e90ddcae5dd7fb6eb70e49f978979979cf39985.tar.bz2 dexon-solidity-9e90ddcae5dd7fb6eb70e49f978979979cf39985.tar.lz dexon-solidity-9e90ddcae5dd7fb6eb70e49f978979979cf39985.tar.xz dexon-solidity-9e90ddcae5dd7fb6eb70e49f978979979cf39985.tar.zst dexon-solidity-9e90ddcae5dd7fb6eb70e49f978979979cf39985.zip |
Merge pull request #2820 from ethereum/fallthrough
Fix some other fallthrough cases
-rw-r--r-- | libsolidity/codegen/ArrayUtils.cpp | 6 | ||||
-rw-r--r-- | libsolidity/codegen/CompilerUtils.cpp | 1 | ||||
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 1 | ||||
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 6 |
4 files changed, 8 insertions, 6 deletions
diff --git a/libsolidity/codegen/ArrayUtils.cpp b/libsolidity/codegen/ArrayUtils.cpp index 67ca22f1..e17188c2 100644 --- a/libsolidity/codegen/ArrayUtils.cpp +++ b/libsolidity/codegen/ArrayUtils.cpp @@ -913,10 +913,10 @@ void ArrayUtils::accessIndex(ArrayType const& _arrayType, bool _doBoundsCheck) c switch (location) { case DataLocation::Memory: - if (_arrayType.isDynamicallySized()) - m_context << u256(32) << Instruction::ADD; - // fall-through case DataLocation::CallData: + if (location == DataLocation::Memory && _arrayType.isDynamicallySized()) + m_context << u256(32) << Instruction::ADD; + if (!_arrayType.isByteArray()) { m_context << Instruction::SWAP1; diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp index a0fc5d55..146472f9 100644 --- a/libsolidity/codegen/CompilerUtils.cpp +++ b/libsolidity/codegen/CompilerUtils.cpp @@ -829,6 +829,7 @@ void CompilerUtils::convertType( break; } } + // fall-through default: // All other types should not be convertible to non-equal types. solAssert(_typeOnStack == _targetType, "Invalid type conversion requested."); diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 639bfc32..45c2170c 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -1047,6 +1047,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess) if (!alsoSearchInteger) break; } + // fall-through case Type::Category::Integer: if (member == "balance") { diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index 8429bf79..4fc8fd13 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -1263,15 +1263,15 @@ ASTPointer<Expression> Parser::parseLeftHandSideExpression( nodeFactory.markEndPosition(); expectToken(Token::RBrack); expression = nodeFactory.createNode<IndexAccess>(expression, index); + break; } - break; case Token::Period: { m_scanner->next(); nodeFactory.markEndPosition(); expression = nodeFactory.createNode<MemberAccess>(expression, expectIdentifierToken()); + break; } - break; case Token::LParen: { m_scanner->next(); @@ -1281,8 +1281,8 @@ ASTPointer<Expression> Parser::parseLeftHandSideExpression( nodeFactory.markEndPosition(); expectToken(Token::RParen); expression = nodeFactory.createNode<FunctionCall>(expression, arguments, names); + break; } - break; default: return expression; } |