Skip to content

Combining --optimize with --no-optimize-yul causes solc to crash #16306

@lum7na

Description

@lum7na

Environment

  • Compiler version: solc 0.8.31

Steps to Reproduce

Compile the following code using the command solc a.sol --bin --optimize --no-optimize-yul

contract C {
  struct A { string a; }
  function f() public returns(A memory) {
    A memory t;
    return t;
  }
}

Output:

Internal compiler error:
/solidity/libsolidity/interface/CompilerStack.cpp(1796): Throw in function std::string solidity::frontend::CompilerStack::createMetadata(const Contract&, bool) const
Dynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>
std::exception::what: Solidity assertion failed
[solidity::util::tag_comment*] = Solidity assertion failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions