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

Unified Diff: src/api.cc

Issue 724023002: Soft fail for invalid cache data. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use flag to indicate rejection 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') | test/cctest/test-api.cc » ('J')
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 c7ebc7714f57a052f99964e44e412a2d66770c7d..a8662d06f29265bf9c82a0d05c302729033f26f1 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1536,7 +1536,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() {
@@ -1752,6 +1755,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') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698