commit | f7ad0c4de87b845ac1279561bff2a9efb41d1229 | [log] [tgz] |
---|---|---|
author | Aske Simon Christensen <askesc@google.com> | Thu Apr 11 13:45:14 2019 +0000 |
committer | commit-bot@chromium.org <commit-bot@chromium.org> | Thu Apr 11 13:45:14 2019 +0000 |
tree | 9bea8fd8d52b991464b112f00736366bc99a9f80 | |
parent | a9f8248bfbfa4378a1a75a80e522b0cbb6f3953b [diff] |
[CFE] Avoid spurious circularity error when an error is evaluated again. Fixes https://github.com/dart-lang/sdk/issues/36563 Change-Id: Ic078ad1f380ee92513948c5f85560db3c6a2941f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99163 Commit-Queue: Aske Simon Christensen <askesc@google.com> Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Auto-Submit: Aske Simon Christensen <askesc@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
diff --git a/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart b/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart index dab1746..173f196 100644 --- a/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart +++ b/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
@@ -655,7 +655,12 @@ result = nodeCache[node] ?? report(node, messageConstEvalCircularity); } else { nodeCache[node] = null; - result = nodeCache[node] = node.accept(this); + try { + result = nodeCache[node] = node.accept(this); + } catch (e) { + nodeCache.remove(node); + rethrow; + } } } else { result = node.accept(this);