Array access fix: g++ darwin 4.2.1 compiler clamped array index to 0 when confronted...
authormvstanton@chromium.org <mvstanton@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 10 Jun 2013 14:44:05 +0000 (14:44 +0000)
committermvstanton@chromium.org <mvstanton@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 10 Jun 2013 14:44:05 +0000 (14:44 +0000)
BUG=247303
R=jkummerow@chromium.org, ulan@chromium.org

Review URL: https://codereview.chromium.org/15855015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15038 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/arguments.h

index b2608e56cc0fe2ab7211ca475decc7c7c8d18f1f..f9dca110c377e846c48da15e3295dced77770ff3 100644 (file)
@@ -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) {