-
Notifications
You must be signed in to change notification settings - Fork 4
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
Print dirty bytes for removed variables #11
Comments
@ZeroEkkusu Can you assign this to me? Also I am a beginner so some context would be nice. Thanks |
Gm, @triggeredcode. Yes, I can! Though, you may find #7 more interesting (and it's more useful). I'll add some description there, in case you change your mind. If not, let me know, and we'll return to this one! |
Hey @ZeroEkkusu ! Is this issue still open for contribution? I would like to work on this. |
@kamuik16 Added! |
@kamuik16, just a heads up that I think I've spotted an edge case. I'll modify the description to explain it. Also, I'll remove the second part (legacy) for now, if that's okay with you. |
Yeah sure. |
@kamuik16 Explained. Please feel free to ping me if I can help with the development. |
Okay. |
Btw, if this is complicated, #8 may be another good choice. I've came up with an easier way to solve it and will describe it there as well. |
Yeah, I guess this is complicated for me as I am yet to take a deeper understanding of the whole script. |
No worries, that's totally understandable. |
If a variable is removed (not overridden), print dirty bytes
to mask.Context
Let's say we start with:
If we remove
b
:Case:
a
doesn't overlapb
In this case we print how many dirty bytes there are.
If we change
a
tobytes2
, and removeb
:Case:
a
partially overlapsb
In this case we don't print how many dirty bytes there are in the overlap, only after it.
If we change
a
tobytes3
, and removeb
:Case:
a
completely overlapsb
In this case we don't print how many dirty bytes there are.
I can suggest one way to solve this:
Create a new function
addDirtyAfterRemoved
that takes two inputs: the old and new layouts.By that, I mean these two variables here:
storage-delta/_reporter.js
Line 30 in 982d947
Call the function immediately after the above line.
What it should do:
For each item in the new layout, check if it's undefined.
If it is, add a dirty item after it to the new layout and an undefined item to the old layout, if applicable, according to the rules we set above.
That should take care of the new dirty items.
For printing dirty bytes at the same line as 🪦, I think we'll have to handle that on the 'ANALYZE' level instead; I mean here:
storage-delta/_reporter.js
Line 41 in 982d947
For example by adding a helper function that checks whether we should just print 🪦 to the report with an empty line, or with the dirty bytes info.
I know this can get complex at times, so feel free to ping me to help you out.
Additional notes
Beware of a situation like this one (I'll add positions for clarity):
Change to:
In this case, the finding should be:
The text was updated successfully, but these errors were encountered: