Radar · Solidity · Archive · Week 51 · Dec 15 – 21, 2025
Lost Storage Array Write on Slot Overflow Bug
Worth knowingcompiler
- What changed
- The Solidity code generator had a bug that could cause deletion and partial assignment operations on fixed‑length storage arrays that cross the 2256‑slot boundary to skip some or all intended storage writes.
- Production impact
- The source does not say.
- Try it
- Verify that a contract with a fixed‑length storage array spanning the slot boundary behaves correctly after upgrading to 0.8.32.
- Source
- soliditylang.org/blog/2025/12/18/lost-storage-array-write-on-slot-overflow-bug
Understand it, then run it
The Solidity compiler had a bug that could skip writing to storage when an array crossed the end of the 256‑bit address space. When an array started near the last slot, operations that clear or copy the array could miss some slots because the compiler compared slot numbers directly. If the array wrapped around, the comparison would think the loop had already finished and nothing would be written. The fix changes the loop to count by index instead of comparing slot numbers, so the loop always runs the correct number of times.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed