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

ICE occurs when --ir-ast-json or --ir-optimized-ast-json is used #15699

Open
P1umH0 opened this issue Jan 9, 2025 · 0 comments
Open

ICE occurs when --ir-ast-json or --ir-optimized-ast-json is used #15699

P1umH0 opened this issue Jan 9, 2025 · 0 comments
Labels

Comments

@P1umH0
Copy link

P1umH0 commented Jan 9, 2025

Description

My fuzzer found a bug where ICE occurred when using --ir-ast-json or --ir-optimized-ast-json

Environment

  • Compiler version: 0.8.28
  • Target EVM version (as per compiler settings): None
  • Framework/IDE (e.g. Truffle or Remix): None
  • EVM execution environment / backend / blockchain client: None
  • Operating system: Ubuntu

Steps to Reproduce

I fed the .sol files in the test/libsolidity directory into my fuzzer as the initial corpus, and it found this bug

the code

contract Test {
    function f() public pure returns (string memory) {
        return type(C).name;
    }
    function g() public pure returns (string memory) {
        return type(A).name;
    }
    function h() public pure returns (string memory) {
        return type(I).name;
    }
}

abstract contract A {
    function f() virtual public pure;
}

interface I {
    function f() external pure;
}

contract C {
    function f() pure public {
    }
}

the cmd

solc --ir-ast-json a.sol
# or
solc --ir-optimized-ast-json a.sol

the bug

Internal compiler error:
/solidity/libsolidity/interface/CompilerStack.cpp(821): Throw in function solidity::yul::YulStack solidity::frontend::CompilerStack::loadGeneratedIR(const string&) const
Dynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>
std::exception::what: 

Invalid IR generated:
Error: Expected keyword "object".



[solidity::util::tag_comment*] = 

Invalid IR generated:
Error: Expected keyword "object".
@P1umH0 P1umH0 added the bug 🐛 label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant