/Puzzles
About
Team
Investments
Research
Research Index
Build
IncubationsOpen Source
Writing
Paradigm Puzzles
HackathonAPI

Terms, Disclosures, Privacy

LinkedIn, Twitter, Contact

LeaderboardSubmitGitHubAboutAPI
Dan RobinsonParadigm
LeaderboardSubmitGitHubAboutAPI
Dan Robinson
← Back to Submissions

struct constructor copies a memory array instead of referencing it

Duplicate

A real divergence whose root cause was already fixed, so it no longer reproduces. No point.

Details

Duplicate of earlier submission e521cccf-ba76-415a-9eb4-809b3f7d18a9 (@forwardsecrecy, 2026-07-24T21:34:45.783Z). This later report observes aliasing through a memory struct's dynamic-array member. It reaches the same premature dereference in generic struct tuple construction as the earlier report. Preserving that pointer makes this exact source return the solc/EVM value 5 without another engine change.

manual-static-and-source-review

Author
@TheBenMeadows
Points
0
Verdict
—
Resolution
Duplicate of an already-fixed root cause
Submitted
Sep 18, 2026, 11:32 PM
Reviewed
Sep 29, 2026, 08:49 PM

Root cause

Duplicate of earlier submission e521cccf-ba76-415a-9eb4-809b3f7d18a9 (@forwardsecrecy, 2026-07-24T21:34:45.783Z). This later report observes aliasing through a memory struct's dynamic-array member. It reaches the same premature dereference in generic struct tuple construction as the earlier report. Preserving that pointer makes this exact source return the solc/EVM value 5 without another engine change.

Source

// SPDX-License-Identifier: MIT
pragma solidity 0.8.35;
/* ===ARENA-MANIFEST===
{
 "deploy": {
  "contract": "C",
  "args": []
 },
 "entry": {
  "function": "run",
  "args": [
   0
  ]
 },
 "feature": "memory-struct-constructor-array-reference",
 "note": "P memory p = P(1, a) with a memory array a, then p.v[1] = 5. In Solidity the struct member refers to the same memory array, so a[1] becomes 5 and solc+EVM returns 5. solidity-lean returns 0, i.e. it gave the struct a copy. Plain array-to-array and struct-to-struct memory aliasing both agree."
}
===END-ARENA-MANIFEST=== */
contract C {
    struct P { uint256 x; uint256[] v; }
    function run(uint256) external pure returns (uint256) {
        uint256[] memory a = new uint256[](2);
        P memory p = P(1, a);
        p.v[1] = 5;
        return a[1];
    }
}