Skip to content

Commit

Permalink
Allow builtins as yul identifier paths in antlr grammar.
Browse files Browse the repository at this point in the history
  • Loading branch information
ekpyron committed Jan 17, 2022
1 parent 7b58afa commit 8a6a3d6
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.

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 {
function() external g;
assembly {
g.address := 0x42
g.selector := 0x23
}
}
}

0 comments on commit 8a6a3d6

Please sign in to comment.