You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiler crashes when a conditional value is assigned to a tuple which contains both memory and calldata variables. (I may be wrong about the exact reasons – this is only from repetitive testing and derivation of a minimal reproducible scenario)
Note: I discovered this bug when trying to return some data from memory and some data from calldata, but it seems it's also triggered when assigning to a tuple. The latter is more minimal, so it's the one being shared. But the original use case of return data is not so easily worked around. In particular, changing the declared returned variable to be located to memory has very severe consequences for returning arrays of structs (my use case), since conversion to memory turns them into arrays of pointers, only to be brought back to the original form for abi encoding, which is very inefficient. So, there is currently no workaround for this issue without using Yul for abi encoding.
Environment
Compiler version: 0.8.30
Compilation pipeline (legacy, IR, EOF): default (IR)
Target EVM version (as per compiler settings): cancun
Description
The compiler crashes when a conditional value is assigned to a tuple which contains both memory and calldata variables. (I may be wrong about the exact reasons – this is only from repetitive testing and derivation of a minimal reproducible scenario)
The error:
Note: I discovered this bug when trying to return some data from memory and some data from calldata, but it seems it's also triggered when assigning to a tuple. The latter is more minimal, so it's the one being shared. But the original use case of return data is not so easily worked around. In particular, changing the declared returned variable to be located to memory has very severe consequences for returning arrays of structs (my use case), since conversion to memory turns them into arrays of pointers, only to be brought back to the original form for abi encoding, which is very inefficient. So, there is currently no workaround for this issue without using Yul for abi encoding.
Environment
Steps to Reproduce
The text was updated successfully, but these errors were encountered: