Skip to content

Assigning the selector of a parent function to a constant crashes solc #16050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
xermicus opened this issue May 14, 2025 · 0 comments · May be fixed by #16053
Open

Assigning the selector of a parent function to a constant crashes solc #16050

xermicus opened this issue May 14, 2025 · 0 comments · May be fixed by #16053
Labels

Comments

@xermicus
Copy link

This Solidity:

contract B {
    function g() public {}
}

contract C is B {
     // the constant keyword triggers the crash
    bytes4 public constant s2 = B.g.selector;
}

crashes the compiler with the following error:

❯ solc --version
solc, the solidity compiler commandline interface
Version: 0.8.30+commit.73712a01.Linux.g++
❯ solc --ir reproducer.sol
Uncaught exception:
Dynamic exception type: std::out_of_range
std::exception::what: map::at
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant