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

Reevaluate debug sequence points after shortening jumps #3412

Merged

Conversation

Slava0135
Copy link
Contributor

@Slava0135 Slava0135 commented Apr 14, 2024

Problem

Debug sequence points offsets were not updated after removing NOP during jump shortening

Solution

Count NOPs before seqpoint and offset opcodes on this amount
Added tests to check that reevaluation was correct

@Slava0135
Copy link
Contributor Author

question: should debug points be removed if they were replaced with NOP, panic or keep code as is?

@roman-khimov
Copy link
Member

should debug points be removed if they were replaced with NOP

Likely we'll just have several points at the same offset and then hi, #2428.

Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you, please, squash the commits and add signoff-by to the commit message?

The fix itself looks legit, let me test it a bit.

@AnnaShaleva AnnaShaleva added this to the v0.106.0 milestone Apr 15, 2024
Copy link

codecov bot commented Apr 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.17%. Comparing base (fb4a4f0) to head (9b688a9).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3412      +/-   ##
==========================================
+ Coverage   86.10%   86.17%   +0.06%     
==========================================
  Files         331      331              
  Lines       38107    38114       +7     
==========================================
+ Hits        32813    32845      +32     
+ Misses       3780     3751      -29     
- Partials     1514     1518       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Slava0135 Slava0135 force-pushed the fix-seq-points-after-shorten-jump branch from e55268c to cce2b8e Compare April 15, 2024 11:08
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please, add compiler: prefix to the commit message. Like the following: compiler: reevaluate debug sequence points after shortening jumps. Ref. https://github.com/nspcc-dev/.github/blob/master/git.md#commit-messages.

@AnnaShaleva AnnaShaleva added bug Something isn't working compiler Go smart contract compiler labels Apr 16, 2024
@Slava0135 Slava0135 force-pushed the fix-seq-points-after-shorten-jump branch from cce2b8e to 9b688a9 Compare April 16, 2024 07:39
@AnnaShaleva
Copy link
Member

@roman-khimov, agree to merge?

Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be a nice fix.

@roman-khimov roman-khimov merged commit 83fdcc8 into nspcc-dev:master Apr 18, 2024
20 checks passed
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 Go smart contract compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants