Skip to content

Instantly share code, notes, and snippets.

@bnoordhuis
Created February 4, 2012 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnoordhuis/893d44a6cbb55f531961 to your computer and use it in GitHub Desktop.
Save bnoordhuis/893d44a6cbb55f531961 to your computer and use it in GitHub Desktop.
preparser/preparser-process.cc patch
diff --git a/preparser/preparser-process.cc b/preparser/preparser-process.cc
index b0aeb81..368f63f 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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment