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

Unified Diff: preparser/preparser-process.cc

Issue 9431028: Prevent segfault when preparser fails due to lack of argument. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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: preparser/preparser-process.cc
diff --git a/preparser/preparser-process.cc b/preparser/preparser-process.cc
index b0aeb81e2a4d801f7ed9579fccbc6c23a8f58add..368f63f6ce5d7149508df0ebf273ce9a639dcf75 100644
--- a/preparser/preparser-process.cc
+++ b/preparser/preparser-process.cc
@@ -200,12 +200,14 @@ void fail(v8::PreParserData* data, const char* message, ...) {
vfprintf(stderr, message, args);
va_end(args);
fflush(stderr);
- // Print preparser data to stdout.
- uint32_t size = data->size();
- fprintf(stderr, "LOG: data size: %u\n", size);
- if (!WriteBuffer(stdout, data->data(), size)) {
- perror("ERROR: Writing data");
- fflush(stderr);
+ if (data != NULL) {
+ // Print preparser data to stdout.
+ uint32_t size = data->size();
+ fprintf(stderr, "LOG: data size: %u\n", size);
+ if (!WriteBuffer(stdout, data->data(), size)) {
+ perror("ERROR: Writing data");
+ fflush(stderr);
+ }
}
exit(EXIT_FAILURE);
}
« 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