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

Don't crash when calling gc() on a committed TyperState #13408

Merged
merged 1 commit into from
Aug 28, 2021

Conversation

smarter
Copy link
Member

@smarter smarter commented Aug 28, 2021

An already-committed TyperState might be committed into when errors are
flushed (cf #12827, #13150) and commit() calls gc(). This operation
could crash before this commit because we attempted to instantiate type
variables no longer owned by the TyperState. We fix this by clearing
ownedVars when committing a TyperState (because after committing it no
longer owns any type variable).

Fixes #13407.

An already-committed TyperState might be committed again when errors are
flushed (cf scala#12827, scala#13150) and `commit()` calls `gc()`. This operation
could crash before this commit because we attempted to instantiate type
variables no longer owned by the TyperState. We fix this by clearing
`ownedVars` when committing a TyperState (because after committing it no
longer owns any type variable).

Fixes scala#13407.
@odersky odersky merged commit f819617 into scala:master Aug 28, 2021
@odersky odersky deleted the committed-ownedVars branch August 28, 2021 15:37
@Kordyjan Kordyjan added this to the 3.1.0 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
3 participants