1.1 --- a/src/Interpreter.cpp Thu Dec 27 21:07:03 2012 -0800
1.2 +++ b/src/Interpreter.cpp Fri Dec 28 17:13:51 2012 -0800
1.3 @@ -986,6 +986,26 @@
1.4 break;
1.5 }
1.6
1.7 +case OP_DEPARRAY:
1.8 +{
1.9 + Local<ArrayMap> map(zone, ArrayMap::cast(top.fp->code()->object(READ_UINT32(top.pc))));
1.10 + Local<Array> array(zone, Array::cast(top.sp[-2].obj));
1.11 + int index = top.sp[-1].i32;
1.12 +
1.13 + // We allow taking 0-length dependent arrays.
1.14 + if (index < 0 || unsigned(index) > array->length()) {
1.15 + zone->reportError(Message_ArrayIndexOutOfBounds, index, array->length());
1.16 + goto error;
1.17 + }
1.18 +
1.19 + top.sp[-2].obj = DependentArray::New(zone, array, map, index);
1.20 + if (!top.sp[-2].obj)
1.21 + goto error;
1.22 +
1.23 + top.sp--;
1.24 + break;
1.25 +}
1.26 +
1.27 default:
1.28 assert(false);
1.29 return false;