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

Unified Diff: src/objects-inl.h

Issue 2501963002: MIPS: Fix `This CL enables precise source positions for all V8 compilers` (Closed)
Patch Set: Rewrite DCHECK to avoid signed overflow Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 9100c114141cab10af5f74f4d8b3f98c9504cea5..7e93a230be336dcac91d334f053e9126cfc0af48 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4126,14 +4126,14 @@ void ByteArray::set(int index, byte value) {
}
void ByteArray::copy_in(int index, const byte* buffer, int length) {
- DCHECK(index >= 0 && length >= 0 && index + length >= index &&
+ DCHECK(index >= 0 && length >= 0 && length <= kMaxInt - index &&
index + length <= this->length());
byte* dst_addr = FIELD_ADDR(this, kHeaderSize + index * kCharSize);
memcpy(dst_addr, buffer, length);
}
void ByteArray::copy_out(int index, byte* buffer, int length) {
- DCHECK(index >= 0 && length >= 0 && index + length >= index &&
+ DCHECK(index >= 0 && length >= 0 && length <= kMaxInt - index &&
index + length <= this->length());
const byte* src_addr = FIELD_ADDR(this, kHeaderSize + index * kCharSize);
memcpy(buffer, src_addr, length);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698