Skip to content
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

IR codegen does not implement access to library address by contract name #15669

Open
cameel opened this issue Dec 20, 2024 · 0 comments
Open
Labels
bug 🐛 low effort There is not much implementation work to be done. The task is very easy or tiny. low impact Changes are not very noticeable or potential benefits are limited. must have eventually Something we consider essential but not enough to prevent us from releasing Solidity 1.0 without it. should compile without error Error is reported even though it shouldn't. Source is fine.

Comments

@cameel
Copy link
Member

cameel commented Dec 20, 2024

Discovered in #15661 (comment)

Description

A reference to a library name in inline assembly triggers an unimplemented feature error. At this point the IR codegen is considered feature-complete so this not being implemented yet is a bug.

Moreover the error does not provide any message for the user.

While we do have this case covered by a syntax test (assignment_from_library.sol), it went undiscovered until now because we don't run syntax tests via IR. When the bug is fixed, please remember to enable this test on EOF.

Environment

  • Compiler version: 0.8.28 (develop)

Steps to Reproduce

test.sol:

library L {}

contract C {
    function f() public pure {
        assembly {
            let x := L
        }
    }
}
solc test.sol --ir
Error: Unimplemented feature
 --> test.sol:5:9:
  |
5 |         assembly {
  |         ^ (Relevant source part starts here and spans across multiple lines).
@cameel cameel added bug 🐛 low effort There is not much implementation work to be done. The task is very easy or tiny. low impact Changes are not very noticeable or potential benefits are limited. must have eventually Something we consider essential but not enough to prevent us from releasing Solidity 1.0 without it. should compile without error Error is reported even though it shouldn't. Source is fine. labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 low effort There is not much implementation work to be done. The task is very easy or tiny. low impact Changes are not very noticeable or potential benefits are limited. must have eventually Something we consider essential but not enough to prevent us from releasing Solidity 1.0 without it. should compile without error Error is reported even though it shouldn't. Source is fine.
Projects
None yet
Development

No branches or pull requests

1 participant