From 9cf0a42210370cf11028ee03fb7eff7e656c1f4a Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sat, 6 Jun 2009 16:36:07 -0600 Subject: [PATCH] respect string offset in stringCharAt --- src/machine.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/machine.h b/src/machine.h index a458557318..54d2fc473b 100644 --- a/src/machine.h +++ b/src/machine.h @@ -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); } }