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

Unified Diff: lib/binary/ast_to_binary.dart

Issue 2483243002: Fixed crash when compiling without linking. (Closed)
Patch Set: Created 4 years, 1 month 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: lib/binary/ast_to_binary.dart
diff --git a/lib/binary/ast_to_binary.dart b/lib/binary/ast_to_binary.dart
index 7611523b492186adc6f51f5abcbdfd26d61afea2..4e05ca45adedc678cf0fbd898219caf7502e6655 100644
--- a/lib/binary/ast_to_binary.dart
+++ b/lib/binary/ast_to_binary.dart
@@ -92,7 +92,12 @@ class BinaryPrinter extends Visitor {
}
void writeUriReference(String string) {
- writeUInt30(_sourceUriIndexer[string]);
+ int index = _sourceUriIndexer[string];
+ if (index == null) {
+ // Assume file was loaded without linking. Bail out to empty string.
+ index = _sourceUriIndexer[""];
+ }
+ writeUInt30(index);
}
void writeList(List items, writeItem(x)) {
« 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