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

Unified Diff: dart/lib/compiler/implementation/compiler.dart

Issue 10392104: Diagnose compiler crashes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 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 | dart/lib/compiler/implementation/scanner/scanner_task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/compiler.dart
diff --git a/dart/lib/compiler/implementation/compiler.dart b/dart/lib/compiler/implementation/compiler.dart
index 092ba2ecc561c959c277435ae5aa175ed247e708..7201c1e1c0304d28de117dc3e3d95b50928057e4 100644
--- a/dart/lib/compiler/implementation/compiler.dart
+++ b/dart/lib/compiler/implementation/compiler.dart
@@ -17,8 +17,15 @@ class WorkItem {
String run(Compiler compiler) {
String code = compiler.universe.generatedCode[element];
if (code !== null) return code;
- if (!isAnalyzed()) compiler.analyze(this);
- return compiler.codegen(this);
+ try {
+ if (!isAnalyzed()) compiler.analyze(this);
+ return compiler.codegen(this);
+ } catch (CompilerCancelledException ex) {
+ throw;
+ } catch (var ex) {
+ compiler.unhandledExceptionOnElement(element);
+ throw;
+ }
}
}
@@ -138,6 +145,12 @@ class Compiler implements DiagnosticListener {
});
}
+ void unhandledExceptionOnElement(Element element) {
+ internalErrorOnElement(element, '''
+An unhandled exception was thrown.
+Please report this problem at http://dartbug.com/new.''');
+ }
+
void cancel([String reason, Node node, Token token,
HInstruction instruction, Element element]) {
SourceSpan span = const SourceSpan(null, null, null);
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/scanner/scanner_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698