Revision: 15038
Author:   [email protected]
Date:     Mon Jun 10 07:44:05 2013
Log: Array access fix: g++ darwin 4.2.1 compiler clamped array index to 0 when confronted with negative indices.

BUG=247303
[email protected], [email protected]

Review URL: https://codereview.chromium.org/15855015
http://code.google.com/p/v8/source/detail?r=15038

Modified:
 /branches/bleeding_edge/src/arguments.h

=======================================
--- /branches/bleeding_edge/src/arguments.h     Mon Jun 10 00:41:16 2013
+++ /branches/bleeding_edge/src/arguments.h     Mon Jun 10 07:44:05 2013
@@ -52,7 +52,8 @@

   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