-
Notifications
You must be signed in to change notification settings - Fork 21
AnyRefMap.getOrElseUpdate is faulty #8213
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
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8213?orig=1 |
@Ichoran said (edited on Jan 30, 2014 6:58:17 PM UTC): |
@Ichoran said: |
fwiw, I think this could plausibly have simply been closed as "wontfix". blowing up if you change the map out from under itself like this doesn't seem like a bug to me, necessarily. /cc @hrhino |
One could |
The dotty compiler crashed with an "ArrayIndexOutofBounds" exception in "getOrElseUpdate" on an AnyRefMap. I could not minimize it, but think I know where the failure comes from. Here's the code of getOrElseUpdate:
The error happens if the defaultValue computation causes a size increase and rehash of the map. In that case the value of
i
seems to be no longer valid.The actual call causing the error was:
Indeed the default value expression
typer.typed(tree, pt)
could easily create enough newtypedTree
entries to cause a rehash.The text was updated successfully, but these errors were encountered: