Skip to content

Commit 79e9d61

Browse files
authored
Merge pull request #12545 from ethereum/yulGrammarFluke
Allow builtins in yul identifier paths in antlr grammar.
2 parents 07d1bc5 + c91f995 commit 79e9d61

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Compiler Features:
1010

1111

1212
Bugfixes:
13+
* Antlr Grammar: Allow builtin names in ``yulPath`` to support ``.address`` in function pointers.
1314
* Control Flow Graph: Perform proper virtual lookup for modifiers for uninitialized variable and unreachable code analysis.
1415
* Immutables: Fix wrong error when the constructor of a base contract uses ``return`` and the parent contract contains immutable variables.
1516
* TypeChecker: Fix ICE when a constant variable declaration forward references a struct.

docs/grammar/SolidityParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ yulFunctionDefinition:
564564
* While only identifiers without dots can be declared within inline assembly,
565565
* paths containing dots can refer to declarations outside the inline assembly block.
566566
*/
567-
yulPath: YulIdentifier (YulPeriod YulIdentifier)*;
567+
yulPath: YulIdentifier (YulPeriod (YulIdentifier | YulEVMBuiltin))*;
568568
/**
569569
* A call to a function with return values can only occur as right-hand side of an assignment or
570570
* a variable declaration.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
contract C {
2+
function f() public pure {
3+
function() external g;
4+
assembly {
5+
g.address := 0x42
6+
g.selector := 0x23
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)