Skip to content

Commit

Permalink
Merge pull request #12545 from ethereum/yulGrammarFluke
Browse files Browse the repository at this point in the history
Allow builtins in yul identifier paths in antlr grammar.
  • Loading branch information
ekpyron committed Jan 17, 2022
2 parents 07d1bc5 + c91f995 commit 79e9d61
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Compiler Features:


Bugfixes:
* Antlr Grammar: Allow builtin names in ``yulPath`` to support ``.address`` in function pointers.
* Control Flow Graph: Perform proper virtual lookup for modifiers for uninitialized variable and unreachable code analysis.
* Immutables: Fix wrong error when the constructor of a base contract uses ``return`` and the parent contract contains immutable variables.
* TypeChecker: Fix ICE when a constant variable declaration forward references a struct.
Expand Down
2 changes: 1 addition & 1 deletion docs/grammar/SolidityParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ yulFunctionDefinition:
* While only identifiers without dots can be declared within inline assembly,
* paths containing dots can refer to declarations outside the inline assembly block.
*/
yulPath: YulIdentifier (YulPeriod YulIdentifier)*;
yulPath: YulIdentifier (YulPeriod (YulIdentifier | YulEVMBuiltin))*;
/**
* A call to a function with return values can only occur as right-hand side of an assignment or
* a variable declaration.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
contract C {
function f() public pure {
function() external g;
assembly {
g.address := 0x42
g.selector := 0x23
}
}
}

0 comments on commit 79e9d61

Please sign in to comment.