Skip to content

SSA-CFG Yul assertion failure in StackLayoutGenerator #16712

@sbauer00

Description

@sbauer00

Description

The program below compiles without problem using --via-ir but throws an assertion failure when using the experimental --via-ssa-cfg.

Environment

  • Compiler version: 0.8.35+commit.47b9dedd
  • Compilation pipeline (legacy, IR, EOF): via SSA CFG
  • Target EVM version (as per compiler settings): -
  • Framework/IDE (e.g. Foundry, Hardhat, Remix): CLI
  • EVM execution environment / backend / blockchain client: -
  • Operating system: macOS & Linux

Steps to Reproduce

pragma solidity ^0.8.19;

contract C {}

contract D {
    function f(
        uint,
        uint,
        uint,
        uint,
        uint,
        uint,
        uint,
        uint,
        uint,
        uint,
        uint,
        uint,
        uint,
        uint,
        uint,
        uint
    ) external {
        new C();
    }
}

CLI command

solc contract.sol --via-ir --experimental --via-ssa-cfg --bin-runtime

Output

Yul assertion failed:
/solidity/libyul/backends/evm/ssa/StackLayoutGenerator.cpp(271): Throw in function void solidity::yul::ssa::StackLayoutGenerator::visitBlock(const SSACFG::BlockId &)
Dynamic exception type: boost::wrapexcept<solidity::yul::YulAssertion>
std::exception::what: Yul assertion failed
[solidity::util::tag_comment*] = Yul assertion failed

Expected Behavior

Should compile without issue.

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