Disallow dot in inline assembly identifiers.

This commit is contained in:
chriseth
2020-07-08 19:29:58 +02:00
parent 64b6524bdb
commit 8eb459c825
11 changed files with 80 additions and 3 deletions
@@ -0,0 +1,12 @@
contract C {
function f() public pure {
assembly {
function f(a., x.b) -> t.b, b.. {}
}
}
}
// ----
// DeclarationError 3927: (74-76): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (78-81): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (86-89): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (91-94): User-defined identifiers in inline assembly cannot contain '.'.
@@ -0,0 +1,11 @@
contract C {
function f() public pure {
assembly {
function f.() {}
function g.f() {}
}
}
}
// ----
// DeclarationError 3927: (63-79): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (86-103): User-defined identifiers in inline assembly cannot contain '.'.
@@ -0,0 +1,11 @@
contract C {
function f() public pure {
assembly {
function f() -> x, y, z {}
let a., aa.b := f()
}
}
}
// ----
// DeclarationError 3927: (100-102): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (104-108): User-defined identifiers in inline assembly cannot contain '.'.
@@ -0,0 +1,15 @@
contract C {
function f() public pure {
assembly {
let a. := 2
let a.. := 2
let a.b := 2
let a..b := 2
}
}
}
// ----
// DeclarationError 3927: (67-69): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (85-88): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (104-107): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (123-127): User-defined identifiers in inline assembly cannot contain '.'.
@@ -0,0 +1,9 @@
contract C {
function f() public pure {
assembly {
let a, .a, aa.b := f()
}
}
}
// ----
// ParserError 2314: (70-71): Expected identifier but got '.'
@@ -15,4 +15,5 @@ contract B {
}
// ----
// DeclarationError 3859: (b:105-106): This declaration shadows a declaration outside the inline assembly block.
// DeclarationError 3927: (b:128-131): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3859: (b:128-131): The prefix of this declaration conflicts with a declaration outside the inline assembly block.
@@ -9,7 +9,6 @@ contract B {
function f() public pure {
assembly {
let A := 1
let A.b := 2
}
}
}
@@ -10,5 +10,7 @@ contract C {
}
}
// ----
// DeclarationError 3927: (115-118): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3859: (115-118): The prefix of this declaration conflicts with a declaration outside the inline assembly block.
// DeclarationError 3927: (140-143): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3859: (140-143): The prefix of this declaration conflicts with a declaration outside the inline assembly block.