Index: runtime/vm/object.h |
diff --git a/runtime/vm/object.h b/runtime/vm/object.h |
index 9d5b4d9e2eaafd9542d20e3c6b44d3414870b892..1796f940f6e1184a653cd711b1e19cc0a7dba1fd 100644 |
--- a/runtime/vm/object.h |
+++ b/runtime/vm/object.h |
@@ -7244,7 +7244,7 @@ class OneByteString : public AllStatic { |
} |
static uint8_t* CharAddr(const String& str, intptr_t index) { |
- ASSERT((index >= 0) && (index < str.Length())); |
+ ASSERT(index == 0 || ((index >= 0) && (index < str.Length()))); |
ASSERT(str.IsOneByteString()); |
return &str.UnsafeMutableNonPointer(raw_ptr(str)->data())[index]; |
} |
@@ -7261,6 +7261,7 @@ class OneByteString : public AllStatic { |
friend class ExternalOneByteString; |
friend class SnapshotReader; |
friend class StringHasher; |
+ friend class Utf8; |
}; |
@@ -7430,7 +7431,7 @@ class ExternalOneByteString : public AllStatic { |
} |
static const uint8_t* CharAddr(const String& str, intptr_t index) { |
- ASSERT((index >= 0) && (index < str.Length())); |
+ ASSERT(index == 0 || ((index >= 0) && (index < str.Length()))); |
ASSERT(str.IsExternalOneByteString()); |
return &(raw_ptr(str)->external_data_->data()[index]); |
} |
@@ -7462,6 +7463,7 @@ class ExternalOneByteString : public AllStatic { |
friend class String; |
friend class SnapshotReader; |
friend class Symbols; |
+ friend class Utf8; |
}; |