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

StackTooDeep in EVMObjectCompiler #15649

Open
haoyang9804 opened this issue Dec 17, 2024 · 0 comments
Open

StackTooDeep in EVMObjectCompiler #15649

haoyang9804 opened this issue Dec 17, 2024 · 0 comments
Labels

Comments

@haoyang9804
Copy link
Contributor

Description

Reproducible test program

contract contract0 {
  struct struct1 {
    bool var2;
  }

  int16 internal var3;

  function func4(int16 var5) internal returns (mapping(int16 => int16[]) storage mapping6, struct1 memory struct_instance10) {
    mapping6 = mapping6;
    struct_instance10 = struct_instance10;
    (bool(false) ? var3 : (var3));
  }

  function func11(mapping(int16 => int16)[] storage array12) internal view returns (int16 var16) {
    struct1 memory struct_instance17;
    struct_instance17 = struct_instance17;
    if (struct_instance17.var2 && (false)) {} else {
      (var3) % (var3);
    }
  }
}

contract contract18 {
  error error19();

  error error20(int16 var21);

  struct struct22 {
    int256[][4] array23;
    contract0.struct1 struct_instance26;
  }

  bool internal var27;

  constructor(contract18.struct22[2] memory array28) {
    contract18.struct22 memory struct_instance38;
    struct_instance38 = struct_instance38;
    contract0.struct1 memory struct_instance39;
    struct_instance39 = struct_instance39;
    true ? struct_instance39 : (struct_instance38.struct_instance26);
  }

  function func30(mapping(string => struct22) storage mapping31) internal returns (contract0 contract_instance34, contract0.struct1 memory struct_instance35) {
    struct_instance35 = struct_instance35;
    (this.func36());
  }

  function func36() external returns (struct22 memory struct_instance37) {
    struct_instance37 = struct_instance37;
    contract0.struct1 memory struct_instance40;
    struct_instance40 = struct_instance40;
    contract18.struct22 memory struct_instance41;
    struct_instance41 = struct_instance41;
    for (; struct_instance40.var2 || var27; var27 ? (struct_instance40) : (struct_instance41.struct_instance26)) {
      var27 ? true : struct_instance41.struct_instance26.var2;
    }
    return (this.func36());
  }
}

Compilation command:

../AFLs/new-solidity/build/solc/solc generated_programs/program_2024-12-17_17:35:8_27.sol --asm --yul-optimizations oEDVnxapifleursthCOScIMjLFUg --optimize-runs 6 --optimize-yul --model-checker-ext-calls untrusted --via-ir

Error message:

Uncaught exception:
/solidity/libyul/backends/evm/EVMObjectCompiler.cpp(106): Throw in function run
Dynamic exception type: boost::wrapexcept<solidity::yul::StackTooDeepError>
std::exception::what: Variable length is 1 too deep in the stack [ _1 length array_2 memoryDataOffset size_1 src offset dst value_1 innerOffset array_5 offset_1 src_1 size_3 array_8 dst_2 elementPos dst_1 ]
memoryguard was present.
[solidity::util::tag_comment*] = Variable length is 1 too deep in the stack [ _1 length array_2 memoryDataOffset size_1 src offset dst value_1 innerOffset array_5 offset_1 src_1 size_3 array_8 dst_2 elementPos dst_1 ]
memoryguard was present.

Environment

  • Compiler version:0.8.29-develop.2024.11.30+commit.b4ecc58b.Linux.g++
@cameel cameel changed the title Uncaught exception in EVMObjectCompiler StackTooDeep in EVMObjectCompiler Dec 18, 2024
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