foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.31k stars 1.75k forks source link

Forge eip712 does not gracefully handle recursive types #9312

Closed DaniPopes closed 1 day ago

DaniPopes commented 2 days ago

Component

Forge

Have you ensured that all of these are up to date?

What version of Foundry are you on?

forge 0.2.0 (4817280 2024-11-13T00:21:56.193283930Z)

What command(s) is the bug in?

forge eip712 src/Counter.sol

Operating System

Linux

Describe the bug

struct Rec {
    Rec[] rec;
}

Now I don't know how this is handled in EIP-712 itself but forge currently overflows the stack:

[⠊] Compiling...
[⠒] Compiling 1 files with Solc 0.8.28
[⠢] Solc 0.8.28 finished in 4.18ms
No files changed, compilation skipped

thread 'main' has overflowed its stack
fatal runtime error: stack overflow
[1]    507913 IOT instruction (core dumped)  forge eip712 src/Counter.sol

cc @klkvr