Chromium Code Reviews| Index: runtime/bin/gen_snapshot.cc |
| diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc |
| index cf1ba385e2362470dfa58e6859159d3b17b22836..e70f170e58a80e9e377f84a5ebdf79ef5870777f 100644 |
| --- a/runtime/bin/gen_snapshot.cc |
| +++ b/runtime/bin/gen_snapshot.cc |
| @@ -382,7 +382,12 @@ static void WriteSnapshotFile(const char* filename, |
| const uint8_t* buffer, |
| const intptr_t size) { |
| File* file = File::Open(filename, File::kWriteTruncate); |
| - ASSERT(file != NULL); |
| + if (file == NULL) { |
| + Log::PrintErr("Error: Unable to write snapshot file: %s\n\n", filename); |
| + Dart_ExitScope(); |
| + Dart_ShutdownIsolate(); |
| + exit(255); |
|
rmacnak
2016/10/21 22:34:30
kErrorExitCode
|
| + } |
| if (!file->WriteFully(buffer, size)) { |
| Log::PrintErr("Error: Failed to write snapshot file.\n\n"); |
| } |