respect string offset in stringCharAt

This commit is contained in:
Joel Dice 2009-06-06 16:36:07 -06:00
parent ac34bc072c
commit 9cf0a42210

View File

@ -1926,9 +1926,9 @@ stringCharAt(Thread* t, object s, int i)
if (objectClass(t, data)
== arrayBody(t, t->m->types, Machine::ByteArrayType))
{
return byteArrayBody(t, data, i);
return byteArrayBody(t, data, stringOffset(t, s) + i);
} else {
return charArrayBody(t, data, i);
return charArrayBody(t, data, stringOffset(t, s) + i);
}
}