mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Treat magic variables as unknown identifiers in inline assembly
This fixes #4575. For keywords such as 'super' and 'this', will be treated as unknown identifiers.
This commit is contained in:
@@ -2,12 +2,18 @@ contract C {
|
||||
function f() public {
|
||||
assembly {
|
||||
super := 1
|
||||
this := 1
|
||||
msg := 1
|
||||
block := 1
|
||||
f := 1
|
||||
C := 1
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (58-63): Only local variables can be assigned to in inline assembly.
|
||||
// TypeError: (75-76): Only local variables can be assigned to in inline assembly.
|
||||
// TypeError: (88-89): Only local variables can be assigned to in inline assembly.
|
||||
// DeclarationError: (58-63): Variable not found or variable not lvalue.
|
||||
// DeclarationError: (75-79): Variable not found or variable not lvalue.
|
||||
// DeclarationError: (91-94): Variable not found or variable not lvalue.
|
||||
// DeclarationError: (106-111): Variable not found or variable not lvalue.
|
||||
// TypeError: (123-124): Only local variables can be assigned to in inline assembly.
|
||||
// TypeError: (136-137): Only local variables can be assigned to in inline assembly.
|
||||
|
||||
Reference in New Issue
Block a user