mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Some fixes taking other pull requests into account.
This commit is contained in:
parent
e21df35416
commit
1d4219d43d
@ -664,9 +664,8 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
|
|||||||
// stack: newLength storageSlot slotOffset
|
// stack: newLength storageSlot slotOffset
|
||||||
arguments[0]->accept(*this);
|
arguments[0]->accept(*this);
|
||||||
// stack: newLength storageSlot slotOffset argValue
|
// stack: newLength storageSlot slotOffset argValue
|
||||||
TypePointer type = arguments[0]->annotation().type;
|
TypePointer type = arguments[0]->annotation().type->closestTemporaryType(arrayType->baseType());
|
||||||
utils().convertType(*type, *arrayType->baseType());
|
utils().convertType(*arguments[0]->annotation().type, *type);
|
||||||
type = arrayType->baseType();
|
|
||||||
utils().moveToStackTop(1 + type->sizeOnStack());
|
utils().moveToStackTop(1 + type->sizeOnStack());
|
||||||
utils().moveToStackTop(1 + type->sizeOnStack());
|
utils().moveToStackTop(1 + type->sizeOnStack());
|
||||||
// stack: newLength argValue storageSlot slotOffset
|
// stack: newLength argValue storageSlot slotOffset
|
||||||
|
@ -109,13 +109,9 @@ ASTPointer<SourceUnit> parseAndAnalyse(string const& _source)
|
|||||||
return sourceAndError.first;
|
return sourceAndError.first;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool success(std::string const& _source)
|
bool success(string const& _source)
|
||||||
{
|
{
|
||||||
auto sourceAndError = parseAnalyseAndReturnError(_source);
|
return !parseAnalyseAndReturnError(_source).second;
|
||||||
|
|
||||||
if (sourceAndError.second && *sourceAndError.second == Error::Type::TypeError)
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Error::Type expectError(std::string const& _source, bool _warning = false)
|
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)
|
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)
|
BOOST_AUTO_TEST_CASE(multi_variable_declaration_wildcards_fail_5)
|
||||||
|
@ -1012,7 +1012,7 @@ BOOST_AUTO_TEST_CASE(tuples)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
BOOST_CHECK_NO_THROW(parseText(text));
|
BOOST_CHECK(successParse(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
Loading…
Reference in New Issue
Block a user