Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index 0ff11f2281612260d87e51467b7caca13f6d935b..f07f37ebb2b271cc6466ff2dde8af462adb0a9a7 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -854,8 +854,10 @@ FunctionLiteral* Parser::ParseProgram() { |
PrintF(" - took %0.3f ms]\n", ms); |
} |
if (cached_data_mode_ == PRODUCE_CACHED_DATA) { |
- Vector<unsigned> store = recorder.ExtractData(); |
- *cached_data_ = new ScriptData(store); |
+ if (result != NULL) { |
+ Vector<unsigned> store = recorder.ExtractData(); |
+ *cached_data_ = new ScriptData(store); |
+ } |
log_ = NULL; |
} |
return result; |