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

Unified Diff: runtime/vm/dart_api_impl.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 | « runtime/vm/clustered_snapshot.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index c1a2f369286b3fca8866120a314a42487012fa5b..f6f3ab841fbf2278defc14a570a591ded15f02dd 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -616,7 +616,7 @@ bool Api::GetNativeReceiver(NativeArguments* arguments, intptr_t* value) {
RawObject* raw_obj = arguments->NativeArg0();
if (raw_obj->IsHeapObject()) {
intptr_t cid = raw_obj->GetClassId();
- if (cid > kNumPredefinedCids) {
+ if (cid >= kNumPredefinedCids) {
ASSERT(Instance::Cast(Object::Handle(raw_obj)).IsValidNativeIndex(0));
RawTypedData* native_fields = *reinterpret_cast<RawTypedData**>(
RawObject::ToAddr(raw_obj) + sizeof(RawObject));
@@ -701,7 +701,7 @@ bool Api::GetNativeFieldsOfArgument(NativeArguments* arguments,
RawObject* raw_obj = arguments->NativeArgAt(arg_index);
if (raw_obj->IsHeapObject()) {
intptr_t cid = raw_obj->GetClassId();
- if (cid > kNumPredefinedCids) {
+ if (cid >= kNumPredefinedCids) {
RawTypedData* native_fields = *reinterpret_cast<RawTypedData**>(
RawObject::ToAddr(raw_obj) + sizeof(RawObject));
if (native_fields == TypedData::null()) {
« no previous file with comments | « runtime/vm/clustered_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698