Reviewers: Sven,

Description:
Add missing bounds check in FixedArray::set for smis

[email protected]
BUG=none
TEST=none


Please review this at http://codereview.chromium.org/7564010/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/objects-inl.h


Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 3f0eeb4301794db78f1480c2b1fac4556db7cd0f..9789118f777bb24e337db1a84493d065aa0142a9 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1612,6 +1612,7 @@ Object* FixedArray::get(int index) {

 void FixedArray::set(int index, Smi* value) {
   ASSERT(map() != HEAP->fixed_cow_array_map());
+  ASSERT(index >= 0 && index < this->length());
   ASSERT(reinterpret_cast<Object*>(value)->IsSmi());
   int offset = kHeaderSize + index * kPointerSize;
   WRITE_FIELD(this, offset, value);


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to