Array access fix: g++ darwin 4.2.1 compiler clamped array index to 0 when...

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

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
parent 09495dfe
...@@ -52,7 +52,8 @@ class Arguments BASE_EMBEDDED { ...@@ -52,7 +52,8 @@ class Arguments BASE_EMBEDDED {
Object*& operator[] (int index) { Object*& operator[] (int index) {
ASSERT(0 <= index && index < length_); 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) { template <class S> Handle<S> at(int index) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment