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

Assembly references to storage variables are not included #602

Open
fvictorio opened this issue Sep 20, 2024 · 0 comments
Open

Assembly references to storage variables are not included #602

fvictorio opened this issue Sep 20, 2024 · 0 comments
Labels
status:ready This issue is ready to be worked on type:improvement Improvement existing feature

Comments

@fvictorio
Copy link
Member

fvictorio commented Sep 20, 2024

"Go to references" works well with assembly for local variables. For example, using it with value here correctly includes the assembly line:

uint value;

assembly {
  value = 1
}

But if you do the same thing with a storage variable, then it doesn't work:

contract Foo {
  uint public x;

  function inc() public {
    x++;
  }
  
  function set(uint _x) public {
    x = _x;
  }

  function setWithAssembly(uint _x) public {
    assembly {
      sstore(x.slot, _x)
    }
  }
}

Here, the references list for x includes x++ and x = _x, but it doesn't include sstore(x.slot, _x).

@fvictorio fvictorio added the type:improvement Improvement existing feature label Sep 20, 2024
@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on type:improvement Improvement existing feature
Projects
None yet
Development

No branches or pull requests

1 participant