Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory-write-overlap bug #6361

Closed
hal3e opened this issue Aug 6, 2024 · 0 comments · Fixed by #6359
Closed

Memory-write-overlap bug #6361

hal3e opened this issue Aug 6, 2024 · 0 comments · Fixed by #6359
Assignees
Labels
bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged

Comments

@hal3e
Copy link
Contributor

hal3e commented Aug 6, 2024

Related Component

compiler

Problem

In the simple contract example blow, line 11 leads to a MemoryWriteOverlap revert.

contract;

abi MyContract {
    fn test();
}

impl MyContract for Contract {
    fn test() {
        let mut latest_random_seed = 1;
        // Error line 11. Assigning a different value works as expected
        latest_random_seed = latest_random_seed;
    }
}

as written in the comment if we assign a value example: latest_random_seed = 42; the contract method will not panic.

Steps

  1. Clone https://github.com/Braqzen/memory-write-overlap-bug
  2. In the repo forc build
  3. Then cargo test

Possible Solution(s)

No response

Notes

No response

Installed components

forc - 0.62.0
@hal3e hal3e added bug Something isn't working triage This issue was opened with a template and needs to be triaged by code owners. labels Aug 6, 2024
@IGI-111 IGI-111 added compiler General compiler. Should eventually become more specific as the issue is triaged and removed triage This issue was opened with a template and needs to be triaged by code owners. labels Aug 6, 2024
esdrubal pushed a commit that referenced this issue Aug 13, 2024
## Description

Fixes  #6321
Fixes #6360
Fixes #6361

---------

Co-authored-by: IGI-111 <igi-111@protonmail.com>
Co-authored-by: Sophie Dankel <47993817+sdankel@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants