Skip to content
New issue

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

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

Already on GitHub? # to your account

Dead Memory #48

Open
Tracked by #43
ControlCplusControlV opened this issue Dec 17, 2022 · 1 comment
Open
Tracked by #43

Dead Memory #48

ControlCplusControlV opened this issue Dec 17, 2022 · 1 comment

Comments

@ControlCplusControlV
Copy link
Owner

No description provided.

@ControlCplusControlV
Copy link
Owner Author

Dead Memory

If a value is stored in memory, once it's location is never read from again the compiler can consider that memory as "free," and overwrite it

Test Cases

  1. Yul Input
{
    let x:u32 := 700
    mstore(0x100, x)

    let z := mload(0x100)
    let y:u32 := 100

    let a := add(z, y)
    mstore(0x200, a)
}
  1. Assembly Output
//Should store `a` at memory slot 0x100

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant