Merge pull request #5242 from ethereum/someChecks

Some well-formedness checks for the Yul AST.
This commit is contained in:
chriseth
2018-10-25 12:44:28 +02:00
committed by GitHub
9 changed files with 95 additions and 4 deletions
@@ -0,0 +1,13 @@
contract C {
function f() public pure {
assembly {
function f(a, b) {}
f()
f(1,)
f(,1)
}
}
}
// ----
// ParserError: (113-114): Literal, identifier or instruction expected.
// ParserError: (113-114): Expected primary expression.
@@ -0,0 +1,10 @@
contract C {
function f() public pure {
assembly {
function (a, b) {}
}
}
}
// ----
// ParserError: (72-73): Expected identifier but got '('
// ParserError: (79-80): Expected ';' but got '{'
@@ -0,0 +1,10 @@
contract C {
function f() public pure {
assembly {
let x := 0100
}
}
}
// ----
// ParserError: (72-73): Literal, identifier or instruction expected.
// ParserError: (72-73): Expected primary expression.
@@ -0,0 +1,11 @@
contract C {
function f() public pure {
assembly {
let x := mload(0)
:= 1
}
}
}
// ----
// ParserError: (87-88): Literal, identifier or instruction expected.
// ParserError: (87-88): Expected primary expression.