mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1169 from ethereum/inline-assembly-tags
Fix assignment after tags in inline assembly
This commit is contained in:
commit
48ac970677
@ -9,6 +9,7 @@ Features:
|
|||||||
Bugfixes:
|
Bugfixes:
|
||||||
* Disallow unknown options in `solc`
|
* Disallow unknown options in `solc`
|
||||||
* Inline assembly: support the `address` opcode
|
* Inline assembly: support the `address` opcode
|
||||||
|
* Inline assembly: fix parsing of assignment after a label.
|
||||||
|
|
||||||
### 0.4.2 (2016-09-17)
|
### 0.4.2 (2016-09-17)
|
||||||
|
|
||||||
|
@ -95,7 +95,9 @@ assembly::Statement Parser::parseStatement()
|
|||||||
fatalParserError("Label name / variable name must precede \":\".");
|
fatalParserError("Label name / variable name must precede \":\".");
|
||||||
assembly::Identifier const& identifier = boost::get<assembly::Identifier>(statement);
|
assembly::Identifier const& identifier = boost::get<assembly::Identifier>(statement);
|
||||||
m_scanner->next();
|
m_scanner->next();
|
||||||
if (m_scanner->currentToken() == Token::Assign)
|
// identifier:=: should be parsed as identifier: =: (i.e. a label),
|
||||||
|
// while identifier:= (being followed by a non-colon) as identifier := (assignment).
|
||||||
|
if (m_scanner->currentToken() == Token::Assign && m_scanner->peekNextToken() != Token::Colon)
|
||||||
{
|
{
|
||||||
// functional assignment
|
// functional assignment
|
||||||
FunctionalAssignment funAss = createWithLocation<FunctionalAssignment>(identifier.location);
|
FunctionalAssignment funAss = createWithLocation<FunctionalAssignment>(identifier.location);
|
||||||
|
@ -157,6 +157,11 @@ BOOST_AUTO_TEST_CASE(oversize_string_literals)
|
|||||||
BOOST_CHECK(!successAssemble("{ let x := \"123456789012345678901234567890123\" }"));
|
BOOST_CHECK(!successAssemble("{ let x := \"123456789012345678901234567890123\" }"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(assignment_after_tag)
|
||||||
|
{
|
||||||
|
BOOST_CHECK(successParse("{ let x := 1 { tag: =: x } }"));
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user