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

Unified Diff: runtime/vm/clustered_snapshot.cc

Issue 2381573002: Fix off-by-one issue in clustered snapshot implementation and api impl (Closed)
Patch Set: same in dart_api_impl Created 4 years, 3 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 | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/clustered_snapshot.cc
diff --git a/runtime/vm/clustered_snapshot.cc b/runtime/vm/clustered_snapshot.cc
index 7fce179d5d8377dc5f19fd7cd106730a76161feb..db4c9c0aff94ec58fda5d8844c41485e74403bec 100644
--- a/runtime/vm/clustered_snapshot.cc
+++ b/runtime/vm/clustered_snapshot.cc
@@ -4312,7 +4312,7 @@ SerializationCluster* Serializer::NewClusterForClass(intptr_t cid) {
return NULL;
#else
Zone* Z = zone_;
- if ((cid > kNumPredefinedCids) ||
+ if ((cid >= kNumPredefinedCids) ||
(cid == kInstanceCid) ||
RawObject::IsTypedDataViewClassId(cid)) {
Push(isolate()->class_table()->At(cid));
@@ -4636,7 +4636,7 @@ DeserializationCluster* Deserializer::ReadCluster() {
intptr_t cid = ReadCid();
Zone* Z = zone_;
- if ((cid > kNumPredefinedCids) ||
+ if ((cid >= kNumPredefinedCids) ||
(cid == kInstanceCid) ||
RawObject::IsTypedDataViewClassId(cid)) {
return new (Z) InstanceDeserializationCluster(cid);
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698