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

Unified Diff: runtime/bin/gen_snapshot.cc

Issue 2440113003: Exit gen_snapshot and log an error if an output file path is invalid (Closed)
Patch Set: Exit gen_snapshot and log an error if an output file path is invalid Created 4 years, 2 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: runtime/bin/gen_snapshot.cc
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index cf1ba385e2362470dfa58e6859159d3b17b22836..05452ae26dffa59dbc800927030c40596ac31866 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(kErrorExitCode);
+ }
if (!file->WriteFully(buffer, size)) {
Log::PrintErr("Error: Failed to write snapshot file.\n\n");
}
« 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