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

[backport] Avoid overeager completion of Java annotations in classfile parser #15277

Merged
merged 1 commit into from
May 24, 2022

Conversation

griggt
Copy link
Contributor

@griggt griggt commented May 23, 2022

This backports #15185 to 3.1.3 which fixes a regression introduced in 3.1.3-RC1.

An alternative fix for scala#15166, which aligns with the behavior of the
Scala 2 classfile parser.

Before this commit, all classfiles, including those produced by the Java
compiler and compilers of other JVM languages, were scanned for Scala
pickling annotations. In certain situations (as in tests/pos/i15166),
this is problematic, as the denotation of an annotation symbol defined as
a Java inner class may be forced before the inner class table is populated
and setClassInfo is called on the class root.

We avoid this situation by only performing the pickling annotation scan for
those classfiles having the `ScalaSig` attribute, i.e. those produced by
the Scala 2 compiler.

We also drop support for pickling TASTy using the classfile annotations
  `scala.annotation.internal.TASTYSignature` and
  `scala.annotation.internal.TASTYLongSignature`.
These were never used by the compiler, there are no plans for future use,
and preserving support would complicate this fix.
@griggt griggt added this to the 3.1.3 milestone May 23, 2022
@griggt griggt requested a review from Kordyjan May 23, 2022 22:14
@Kordyjan Kordyjan merged commit df06ac0 into scala:release-3.1.3 May 24, 2022
@griggt griggt deleted the bport-fix-15166 branch May 24, 2022 07:40
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.

2 participants