diff options
author | chriseth <c@ethdev.com> | 2015-10-16 00:14:14 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-10-16 00:14:14 +0800 |
commit | 1d4219d43d2839c41e56307f9db04cc23d4741e5 (patch) | |
tree | a869be01ad40a760018f3cfbd71bb42bfa5fdf91 | |
parent | e21df35416169a6804f6019c2fbb487c74bad596 (diff) | |
download | dexon-solidity-1d4219d43d2839c41e56307f9db04cc23d4741e5.tar dexon-solidity-1d4219d43d2839c41e56307f9db04cc23d4741e5.tar.gz dexon-solidity-1d4219d43d2839c41e56307f9db04cc23d4741e5.tar.bz2 dexon-solidity-1d4219d43d2839c41e56307f9db04cc23d4741e5.tar.lz dexon-solidity-1d4219d43d2839c41e56307f9db04cc23d4741e5.tar.xz dexon-solidity-1d4219d43d2839c41e56307f9db04cc23d4741e5.tar.zst dexon-solidity-1d4219d43d2839c41e56307f9db04cc23d4741e5.zip |
Some fixes taking other pull requests into account.
-rw-r--r-- | libsolidity/ExpressionCompiler.cpp | 5 | ||||
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 12 | ||||
-rw-r--r-- | test/libsolidity/SolidityParser.cpp | 2 |
3 files changed, 7 insertions, 12 deletions
diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index 909d3fe5..fde88a00 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -664,9 +664,8 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) // stack: newLength storageSlot slotOffset arguments[0]->accept(*this); // stack: newLength storageSlot slotOffset argValue - TypePointer type = arguments[0]->annotation().type; - utils().convertType(*type, *arrayType->baseType()); - type = arrayType->baseType(); + TypePointer type = arguments[0]->annotation().type->closestTemporaryType(arrayType->baseType()); + utils().convertType(*arguments[0]->annotation().type, *type); utils().moveToStackTop(1 + type->sizeOnStack()); utils().moveToStackTop(1 + type->sizeOnStack()); // stack: newLength argValue storageSlot slotOffset diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 0b5a86d7..5002cc4f 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -109,13 +109,9 @@ ASTPointer<SourceUnit> parseAndAnalyse(string const& _source) return sourceAndError.first; } -bool success(std::string const& _source) +bool success(string const& _source) { - auto sourceAndError = parseAnalyseAndReturnError(_source); - - if (sourceAndError.second && *sourceAndError.second == Error::Type::TypeError) - return false; - return true; + return !parseAnalyseAndReturnError(_source).second; } Error::Type expectError(std::string const& _source, bool _warning = false) @@ -2472,7 +2468,7 @@ BOOST_AUTO_TEST_CASE(tuples) } } )"; - BOOST_CHECK_NO_THROW(parseAndAnalyse(text)); + BOOST_CHECK(success(text)); } BOOST_AUTO_TEST_CASE(tuples_empty_components) @@ -2484,7 +2480,7 @@ BOOST_AUTO_TEST_CASE(tuples_empty_components) } } )"; - SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError); + BOOST_CHECK(expectError(text) == Error::Type::TypeError); } BOOST_AUTO_TEST_CASE(multi_variable_declaration_wildcards_fail_5) diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index 9aa4a8ef..c181ae7e 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -1012,7 +1012,7 @@ BOOST_AUTO_TEST_CASE(tuples) } } )"; - BOOST_CHECK_NO_THROW(parseText(text)); + BOOST_CHECK(successParse(text)); } BOOST_AUTO_TEST_SUITE_END() |