aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Denotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-07-01 18:47:52 +0200
committerMartin Odersky <odersky@gmail.com>2015-07-06 17:46:48 +0200
commita939ac843291cc5080546c66272a4310c0657ed8 (patch)
tree32da89c651ec06100df7d9d63e1e1e53f589741b /src/dotty/tools/dotc/core/Denotations.scala
parent4315ed21e564713e606c04eced62ddec2494183b (diff)
downloaddotty-a939ac843291cc5080546c66272a4310c0657ed8.tar.gz
dotty-a939ac843291cc5080546c66272a4310c0657ed8.tar.bz2
dotty-a939ac843291cc5080546c66272a4310c0657ed8.zip
Try to avoid datarace involving NoDenotation
The thread-shared value NoDenotation has a validity with run-id that got updated to the run-id of the current thread. This caused a partest failure with a "demanding denotation outside its range" error. We now treat NoDenotation specially in current, hoping this will avoid the condition.
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala
index 70ca88702..fc97fb32b 100644
--- a/src/dotty/tools/dotc/core/Denotations.scala
+++ b/src/dotty/tools/dotc/core/Denotations.scala
@@ -556,7 +556,7 @@ object Denotations {
*/
private def bringForward()(implicit ctx: Context): SingleDenotation = this match {
case denot: SymDenotation if ctx.stillValid(denot) =>
- if (denot.exists) assert(ctx.runId > validFor.runId, s"denotation $denot invalid in run ${ctx.runId}. ValidFor: $validFor")
+ assert(ctx.runId > validFor.runId, s"denotation $denot invalid in run ${ctx.runId}. ValidFor: $validFor")
var d: SingleDenotation = denot
do {
d.validFor = Period(ctx.period.runId, d.validFor.firstPhaseId, d.validFor.lastPhaseId)
@@ -592,7 +592,9 @@ object Denotations {
assert(false)
}
- if (valid.runId != currentPeriod.runId) initial.bringForward.current
+ if (valid.runId != currentPeriod.runId)
+ if (exists) initial.bringForward.current
+ else this
else {
var cur = this
if (currentPeriod.code > valid.code) {