viaIR: true, but still got YulException: Variable expr_25 is 1 too deep in the stack
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 29
Description
Description
I would have expected my code to compile, but I got "too deep in the stack" error. This is because I'm using viaIR: true (as I handle many variables)
I looked around and found this function which I assume handled the error
https://github.com/ethereum/solidity/blob/develop/libyul/backends/evm/OptimizedEVMCodeTransform.cpp#L273
This only happened after my last commit
Environment
- Compiler version: v0.8.17
- Target EVM version (as per compiler settings): ? default
- Framework/IDE (e.g. Truffle or Remix): Hardhat
- EVM execution environment / backend / blockchain client: Hardhat ?
- Operating system: Ubuntu 22.10
Steps to Reproduce
setup environment
git clone https://github.com/kleros/stake-curate
git checkout 777dfd5f1bdd810491bcfce2794a8ba5c3cc49b3
cd contracts
yarn
compile
npx hardhat size-contracts
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure by checking out commit 777dfd5f1bdd810491bcfce2794a8ba5c3cc49b3 in kleros/stake-curate and running npx hardhat size-contracts. Then inspect libyul/backends/evm/OptimizedEVMCodeTransform.cpp around line 273, where the report suspects the error is handled. Done means the v0.8.17 viaIR compilation no longer reports the YulException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- blockchain, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100