mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #6067 from ethereum/asm-parser-fatal
Do not ignore fatal error in AsmParser for inline assembly
This commit is contained in:
commit
13667d42ec
@ -1043,6 +1043,8 @@ ASTPointer<InlineAssembly> Parser::parseInlineAssembly(ASTPointer<ASTString> con
|
|||||||
|
|
||||||
yul::Parser asmParser(m_errorReporter, yul::EVMDialect::looseAssemblyForEVM());
|
yul::Parser asmParser(m_errorReporter, yul::EVMDialect::looseAssemblyForEVM());
|
||||||
shared_ptr<yul::Block> block = asmParser.parse(m_scanner, true);
|
shared_ptr<yul::Block> block = asmParser.parse(m_scanner, true);
|
||||||
|
if (block == nullptr)
|
||||||
|
BOOST_THROW_EXCEPTION(FatalError());
|
||||||
nodeFactory.markEndPosition();
|
nodeFactory.markEndPosition();
|
||||||
return nodeFactory.createNode<InlineAssembly>(_docString, block);
|
return nodeFactory.createNode<InlineAssembly>(_docString, block);
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,7 @@ shared_ptr<Block> Parser::parse(std::shared_ptr<Scanner> const& _scanner, bool _
|
|||||||
}
|
}
|
||||||
catch (FatalError const&)
|
catch (FatalError const&)
|
||||||
{
|
{
|
||||||
if (m_errorReporter.errors().empty())
|
solAssert(!m_errorReporter.errors().empty(), "Fatal error detected, but no error is reported.");
|
||||||
throw; // Something is weird here, rather throw again.
|
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -7,4 +7,3 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// ParserError: (67-70): Cannot use instruction names for identifier names.
|
// ParserError: (67-70): Cannot use instruction names for identifier names.
|
||||||
// ParserError: (71-73): Expected ';' but got ':='
|
|
||||||
|
@ -10,4 +10,3 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// ParserError: (113-114): Literal, identifier or instruction expected.
|
// ParserError: (113-114): Literal, identifier or instruction expected.
|
||||||
// ParserError: (113-114): Expected primary expression.
|
|
||||||
|
@ -7,4 +7,3 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// ParserError: (72-73): Expected identifier but got '('
|
// ParserError: (72-73): Expected identifier but got '('
|
||||||
// ParserError: (79-80): Expected ';' but got '{'
|
|
||||||
|
@ -7,4 +7,3 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// ParserError: (72-73): Literal, identifier or instruction expected.
|
// ParserError: (72-73): Literal, identifier or instruction expected.
|
||||||
// ParserError: (72-73): Octal numbers not allowed.
|
|
||||||
|
@ -8,4 +8,3 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// ParserError: (87-89): Literal, identifier or instruction expected.
|
// ParserError: (87-89): Literal, identifier or instruction expected.
|
||||||
// ParserError: (87-89): Expected primary expression.
|
|
||||||
|
@ -8,4 +8,3 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// ParserError: (102-105): Cannot use instruction names for identifier names.
|
// ParserError: (102-105): Cannot use instruction names for identifier names.
|
||||||
// ParserError: (105-106): Expected ';' but got ','
|
|
||||||
|
@ -7,4 +7,3 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// ParserError: (70-72): Variable name must precede ":=" in assignment.
|
// ParserError: (70-72): Variable name must precede ":=" in assignment.
|
||||||
// ParserError: (70-72): Expected primary expression.
|
|
||||||
|
@ -7,4 +7,3 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// ParserError: (70-71): Label name must precede ":".
|
// ParserError: (70-71): Label name must precede ":".
|
||||||
// ParserError: (70-71): Expected primary expression.
|
|
||||||
|
@ -7,4 +7,3 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// ParserError: (69-70): Literal, identifier or instruction expected.
|
// ParserError: (69-70): Literal, identifier or instruction expected.
|
||||||
// ParserError: (69-70): Expected primary expression.
|
|
||||||
|
@ -8,4 +8,3 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// ParserError: (107-108): Literal, identifier or instruction expected.
|
// ParserError: (107-108): Literal, identifier or instruction expected.
|
||||||
// ParserError: (107-108): Expected primary expression.
|
|
||||||
|
Loading…
Reference in New Issue
Block a user