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

Fix #15107: Avoid re-emitting a LineNumber after only LabelNodes. #16813

Merged

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Feb 2, 2023

There was already some deduplication code to avoid consecutive LineNumber nodes. However, it can happen that LabelNodes appear in-between. In that case, we also want to deduplicate the LineNumbers, since labels do not actually contribute to the final bytecode.

There was already some deduplication code to avoid consecutive
`LineNumber` nodes. However, it can happen that `LabelNode`s
appear in-between. In that case, we also want to deduplicate the
`LineNumber`s, since labels do not actually contribute to the
final bytecode.
@sjrd sjrd force-pushed the no-duplicate-linenumbers-in-bytecode branch from 5df222f to b9b3ed5 Compare February 3, 2023 09:04
Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

Do you want to add the case in #15107 to the test suite, or does it overlap an existing case?

@sjrd
Copy link
Member Author

sjrd commented Feb 3, 2023

It basically overlaps. Virtually every method had this extra line number at the start, as shown by the existing test changes. (to be clear: that's every test that had LineNumbers to begin with!)

@sjrd sjrd merged commit fb584eb into scala:main Feb 3, 2023
@sjrd sjrd deleted the no-duplicate-linenumbers-in-bytecode branch February 3, 2023 14:20
@Kordyjan Kordyjan added this to the 3.3.1 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants