Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: pkg/analyzer/lib/src/task/driver.dart

Issue 1748933005: Fix handling of task model circularities. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Typo fix Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/driver.dart
diff --git a/pkg/analyzer/lib/src/task/driver.dart b/pkg/analyzer/lib/src/task/driver.dart
index a041729d53e56ee3711d044f40ffe6a445942d19..c172ce2e1188162edc4ec2ceb04e9edfcac8b189 100644
--- a/pkg/analyzer/lib/src/task/driver.dart
+++ b/pkg/analyzer/lib/src/task/driver.dart
@@ -397,6 +397,8 @@ abstract class CycleAwareDependencyWalker<Node> {
while (_currentIndices.isNotEmpty) {
Node nextUnevaluatedInput = getNextInput(_path[_currentIndices.last],
_provisionalDependencies[_currentIndices.last]);
+ // If the assertion below fails, it indicates that [getNextInput] did not
+ // skip an input that we asked it to skip.
assert(!_provisionalDependencies[_currentIndices.last]
.contains(nextUnevaluatedInput));
if (nextUnevaluatedInput != null) {
@@ -683,12 +685,7 @@ class WorkItem {
inputTargetedResults.add(new TargetedResult(inputTarget, inputResult));
CacheEntry inputEntry = context.getCacheEntry(inputTarget);
CacheState inputState = inputEntry.getState(inputResult);
- if (skipInputs.any((WorkItem item) =>
- item.target == inputTarget && item.spawningResult == inputResult)) {
- // This input is being skipped due to a circular dependency. Tell the
- // builder that it's not available so we can move on to other inputs.
- builder.currentValueNotAvailable();
- } else if (inputState == CacheState.ERROR) {
+ if (inputState == CacheState.ERROR) {
exception = inputEntry.exception;
return null;
} else if (inputState == CacheState.IN_PROCESS) {
@@ -716,8 +713,16 @@ class WorkItem {
throw new AnalysisException(
'Cannot find task to build $inputResult for $inputTarget');
}
- return new WorkItem(context, inputTarget, descriptor, inputResult,
- level + 1, workOrder);
+ if (skipInputs.any((WorkItem item) =>
+ item.target == inputTarget && item.descriptor == descriptor)) {
+ // This input is being skipped due to a circular dependency. Tell
+ // the builder that it's not available so we can move on to other
+ // inputs.
+ builder.currentValueNotAvailable();
+ } else {
+ return new WorkItem(context, inputTarget, descriptor, inputResult,
+ level + 1, workOrder);
+ }
} on AnalysisException catch (exception, stackTrace) {
this.exception = new CaughtException(exception, stackTrace);
return null;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698