Skip to content

Fix illegal inlining of instructions accessing protected members#4529

Merged
retronym merged 1 commit intoscala:2.11.xfrom
lrytz:inlineAccessibility
Jun 18, 2015
Merged

Fix illegal inlining of instructions accessing protected members#4529
retronym merged 1 commit intoscala:2.11.xfrom
lrytz:inlineAccessibility

Conversation

@lrytz
Copy link
Member

@lrytz lrytz commented May 27, 2015

There were two issues in the new inliner that would cause a
VerifyError and an IllegalAccessError.

First, an access to a public member of package protected class C can
only be inlined if the destination class can access C. This is tested
by t7582b.

Second, an access to a protected member requires the receiver object
to be a subtype of the class where the instruction is located. So
when inlining such an access, we need to know the type of the receiver
object - which we don't have. Therefore we don't inline in this case
for now. This can be fixed once we have a type propagation analyis.
https://github.com/scala-opt/scala/issues/13.
This case is tested by t2106.

@scala-jenkins scala-jenkins added this to the 2.11.7 milestone May 27, 2015
@lrytz
Copy link
Member Author

lrytz commented May 27, 2015

review by @retronym

@lrytz lrytz force-pushed the inlineAccessibility branch from 94d88d8 to 381f424 Compare May 28, 2015 07:53
@lrytz
Copy link
Member Author

lrytz commented May 28, 2015

This should put the https://scala-webapps.epfl.ch/jenkins/view/All/job/scala-nightly-genbcode-2.11.x test back to green, except for run/kmpSliceSearch.scala (see #4505) - should i force the test to delambdafy:inline as you suggested?

@retronym
Copy link
Member

Yes, please force that one for now.

There were two issues in the new inliner that would cause a
VerifyError and an IllegalAccessError.

First, an access to a public member of package protected class C can
only be inlined if the destination class can access C. This is tested
by t7582b.

Second, an access to a protected member requires the receiver object
to be a subtype of the class where the instruction is located. So
when inlining such an access, we need to know the type of the receiver
object - which we don't have. Therefore we don't inline in this case
for now. This can be fixed once we have a type propagation analyis.
https://github.com/scala-opt/scala/issues/13.
This case is tested by t2106.

Force kmpSliceSearch test to delambdafy:inline

See discussion on scala#4505. The issue
will go away when moving to indy-lambda.
@lrytz lrytz force-pushed the inlineAccessibility branch from fcb26a5 to 7db3a58 Compare May 28, 2015 09:42
@lrytz
Copy link
Member Author

lrytz commented May 28, 2015

OK, done, should pass the tests now.

@lrytz
Copy link
Member Author

lrytz commented Jun 17, 2015

I'd like to get this into 2.11.7, so ping @retronym

@retronym
Copy link
Member

LGTM

retronym added a commit that referenced this pull request Jun 18, 2015
Fix illegal inlining of instructions accessing protected members
@retronym retronym merged commit df73cb9 into scala:2.11.x Jun 18, 2015
@lrytz lrytz deleted the inlineAccessibility branch June 24, 2015 07:48
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