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

AST reimport fails for inline assembly with uninitialized variable declarations #13684

Open
cameel opened this issue Nov 7, 2022 · 0 comments
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 Nov 7, 2022

An attempt to import an AST produced by the compiler fails when the original source code contains an inline assembly block with a variable declaration without an initializer:

test.sol

contract C {
    function f() public pure {
        assembly {
            let x
        }
    }
}
solc test.sol --combined-json ast | solc --import-ast -
Failed to import AST: Expected "nodeType" to be of type string!

This is reproducible all the way down to 0.6.2, when the --import-ast option was introduced, though before 0.8.0 the error message was different and it seems to be failing for a different reason (even examples that work on 0.8.x fail on those versions)

Failed to import AST: Top-level node should be a 'SourceUnit'

Discovered by @aart in #13576 (comment).

@cameel cameel added bug 🐛 should compile without error Error is reported even though it shouldn't. Source is fine. 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. labels Nov 7, 2022
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