Repeated error message caused by omitting "--via-ir"
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 29
Description
## Description
The reproducible code (I guess the error is not related to the code but only the compilation flags):
```solidity
contract contract0 {
event event1(int32 var2);
struct struct3 {
string var4;
}
struct struct5 {
struct3[] array6;
int32 var8;
}
struct3 internal struct_instance9;
string internal var10;
constructor(string[2] memory array11) {
emit contract0.event1(int32(-273486664));
}
function func13() internal pure returns (int32 var14, int32 var15) {
struct5 memory struct_instance22;
struct_instance22 = struct_instance22;
struct5 memory struct_instance23;
struct_instance23 = struct_instance23;
(struct_instance23.var8) ^ struct_instance22.var8;
struct5 memory struct_instance24;
struct_instance24 = struct_instance24;
struct5 memory struct_instance25;
struct_instance25 = struct_instance25;
return (struct_instance24.var8, ~struct_instance25.var8);
}
function func16(mapping(int32 => int32) storage mapping17) internal returns (string memory var20, struct5 memory struct_instance21) {
var20 = var20;
struct_instance21 = struct_instance21;
bool var26;
while ((!var26)) {}
}
}
contract contract27 {
error error30(uint128[] array31);
event event28(contract0.struct5 struct_instance29);
struct struct33 {
contract0.struct3 struct_instance34;
mapping(uint128 => string) mapping35;
}
struct struct38 {
string var39;
mapping(int32 => struct33) mapping40;
}
mapping(int32 => struct33) internal mapping47;
bool internal var43;
constructor() {
contract27.struct38 storage struct_instance46;
struct_instance46 = struct_instance46;
var43 ? (mapping47) : struct_instance46.mapping40;
}
function func44() internal returns (string memory var45) {
var45 = var45;
contract0.struct5 memory struct_instance50;
struct_instance50 = struct_instance50;
(struct_instance50.var8)++;
}
}
```
The command:
```
../AFLs/new-solidity/build/solc/solc generated_programs/program_2024-12-16_11:25:29_43.sol --bin-runtime --yul-optimizations amexguhEiFCUrOdI --optimize-yul --optimize --model-checker-ext-calls trusted --model-checker-targets balance --model-checker-invariants reentrancy --model-checker-div-mod-no-slacks --model-checker-bmc-loop-iterations 10 --model-checker-show-proved-safe --model-checker-show-unproved --model-checker-engine bmc
```
Error message
```
Error: Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables. When compiling inline assembly: Variable dataEnd is 1 slot(s) too deep inside the stack. Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables.
```
The `Try compiling with --via-ir` message is thrown by twice.
## Environment
- Compiler version:0.8.29-develop.2024.11.30+commit.b4ecc58b.Linux.g++
Contributor guide
Research direction
Start by reproducing the report with the supplied solc command, flags, and generated_programs/program_2024-12-16_11:25:29_43.sol input. Trace the Stack too deep diagnostic and verify that omitting --via-ir produces the guidance only once; the issue is done when the repeated message no longer appears while the underlying diagnostic remains.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, solidity
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100