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

Unified Diff: src/api.cc

Issue 733023003: Reland "Soft fail for invalid cache data." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix leak Created 6 years, 1 month 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 | « include/v8.h ('k') | src/compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 9a1ff600745869f079c186ee3b8d2e077a713809..1943683e45400b0c98ec1d280a5717f51df64a2c 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1537,7 +1537,10 @@ void ObjectTemplate::SetInternalFieldCount(int value) {
ScriptCompiler::CachedData::CachedData(const uint8_t* data_, int length_,
BufferPolicy buffer_policy_)
- : data(data_), length(length_), buffer_policy(buffer_policy_) {}
+ : data(data_),
+ length(length_),
+ rejected(false),
+ buffer_policy(buffer_policy_) {}
ScriptCompiler::CachedData::~CachedData() {
@@ -1753,6 +1756,8 @@ Local<UnboundScript> ScriptCompiler::CompileUnbound(
source->cached_data = new CachedData(
script_data->data(), script_data->length(), CachedData::BufferOwned);
script_data->ReleaseDataOwnership();
+ } else if (options == kConsumeParserCache || options == kConsumeCodeCache) {
+ source->cached_data->rejected = script_data->rejected();
}
delete script_data;
}
« no previous file with comments | « include/v8.h ('k') | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698