solidity icon indicating copy to clipboard operation
solidity copied to clipboard

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

Open lum7na opened this issue 2 weeks ago • 0 comments

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

lum7na avatar Nov 26 '25 08:11 lum7na