mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix wrong location for inline asm blocks
This commit is contained in:
@@ -1036,7 +1036,8 @@ ASTPointer<Statement> Parser::parseStatement()
|
||||
ASTPointer<InlineAssembly> Parser::parseInlineAssembly(ASTPointer<ASTString> const& _docString)
|
||||
{
|
||||
RecursionGuard recursionGuard(*this);
|
||||
ASTNodeFactory nodeFactory(*this);
|
||||
SourceLocation location{position(), -1, source()};
|
||||
|
||||
expectToken(Token::Assembly);
|
||||
if (m_scanner->currentToken() == Token::StringLiteral)
|
||||
{
|
||||
@@ -1050,8 +1051,9 @@ ASTPointer<InlineAssembly> Parser::parseInlineAssembly(ASTPointer<ASTString> con
|
||||
shared_ptr<yul::Block> block = asmParser.parse(m_scanner, true);
|
||||
if (block == nullptr)
|
||||
BOOST_THROW_EXCEPTION(FatalError());
|
||||
nodeFactory.markEndPosition();
|
||||
return nodeFactory.createNode<InlineAssembly>(_docString, block);
|
||||
|
||||
location.end = block->location.end;
|
||||
return make_shared<InlineAssembly>(location, _docString, block);
|
||||
}
|
||||
|
||||
ASTPointer<IfStatement> Parser::parseIfStatement(ASTPointer<ASTString> const& _docString)
|
||||
|
||||
Reference in New Issue
Block a user