-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Duplicate tag position
when compiling Yul code defining multiple functions with the same name
#12090
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
Comments
Thanks for reporting! My first hunch is that a workaround could be to rename the functions so that the names are unique, but of course, this should also compile as is. |
Duplicate tag position
when compiling Yul code defining multiple functions with the same name
I found a case that triggers an assertion at a different position in the same file on 0.8.9. Seems to be related to this issue - it's caused by Yul functions with the same name and different returns defined in different Solidity functions:
contract C {
function f() external {
assembly {
function x(i) -> a {}
}
}
function g() external {
assembly {
function x(i) {}
}
}
} solc --bin --experimental-via-ir contract.sol
EDIT: The example above is actually inline assembly while this issue is about Yul but I think the cause might be the same and #12139 might be a fix too. |
I decided to report this case as a separate issue after all (#12158) because maybe for inline assembly solution should be different (we don't necessarily have to disable named labels) and because it can't be triggered by only giving the functions the same name. |
Description
While updating dapptools to solc0.8.9 we noticed that the following yul program now produces a c++ exception when compiling with 0.8.9 (it was fine with 0.8.7).
Environment
The text was updated successfully, but these errors were encountered: