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

SI-8459 fix incorrect positions for incomplete selection trees #3988

Merged
merged 1 commit into from Sep 18, 2014

Conversation

ghik
Copy link
Contributor

@ghik ghik commented Sep 17, 2014

The mentioned issue is a presentation compiler issue, but its root cause is a bug in the parser which incorrectly assigned positions to incomplete selection trees (i.e. selections that lack an indentifier after dot and have some whitespace instead).

In detail: for such incomplete selection trees, the "point" of the position should be immediately after the dot but instead was at the start of next token after the dot. For range positions, this caused a pathological situation where the "point" was greater than the "end" of the position. This position is later used by the typechecker during resolution of dynamic calls and causes it to crash. Of course, because a syntactically incorrect code is required for the bug to manifest, it only happens in the presentation compiler.

The mentioned issue is a presentation compiler issue, but its root cause is a bug in the parser which incorrectly assigned positions to incomplete selection trees (i.e. selections that lack an indentifier after dot and have some whitespace instead).

In detail: for such incomplete selection trees, the "point" of the position should be immediately after the dot but instead was at the start of next token after the dot. For range positions, this caused a pathological situation where the "point" was greater than the "end" of the position. This position is later used by the typechecker during resolution of dynamic calls and causes it to crash. Of course, because a syntactically incorrect code is required for the bug to manifest, it only happens in the presentation compiler.
@scala-jenkins scala-jenkins added this to the 2.11.3 milestone Sep 17, 2014
@ghik
Copy link
Contributor Author

ghik commented Sep 18, 2014

review by @scala

@dragos
Copy link
Contributor

dragos commented Sep 18, 2014

This LGTM. Thanks! (as the original reporter of this bug).

SI-8562 might be an easy follow up.

@retronym
Copy link
Member

LGTM, too. Thank you!

retronym added a commit that referenced this pull request Sep 18, 2014
SI-8459 fix incorrect positions for incomplete selection trees
@retronym retronym merged commit 79f59c5 into scala:2.11.x Sep 18, 2014
@ghik ghik deleted the issue/8459 branch September 18, 2014 16:01
@ghik ghik restored the issue/8459 branch April 1, 2017 00:00
@ghik ghik deleted the issue/8459 branch October 24, 2019 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants