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()) { |