solidity
solidity copied to clipboard
Combining --optimize with --no-optimize-yul causes solc to crash
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