Reviewers: ulan, Jakob,

Message:
Hi guys, here is the arguments.h fix, from the bug seen in Android compiles.

Description:
Array access fix: g++ darwin 4.2.1 compiler clamped array index to 0 when
confronted with negative indices.

BUG=247303

Please review this at https://codereview.chromium.org/15855015/

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

Affected files:
  M src/arguments.h


Index: src/arguments.h
diff --git a/src/arguments.h b/src/arguments.h
index e13ddc9ec83f0f69e1bdb53d00a18ca9b5522310..4eac1136ca30e5d86a9f57a6e3938c6247c812a3 100644
--- a/src/arguments.h
+++ b/src/arguments.h
@@ -52,7 +52,8 @@ class Arguments BASE_EMBEDDED {

   Object*& operator[] (int index) {
     ASSERT(0 <= index && index < length_);
-    return arguments_[-index];
+ return *(reinterpret_cast<Object**>(reinterpret_cast<intptr_t>(arguments_) -
+                                        index * kPointerSize));
   }

   template <class S> Handle<S> at(int index) {


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to