handle zero length arrays properly in JNIEnv::NewString

This commit is contained in:
Joel Dice 2012-10-03 08:16:41 -06:00
parent 2a15201b18
commit ab5ec510bf

View File

@ -241,9 +241,8 @@ newString(Thread* t, uintptr_t* arguments)
const jchar* chars = reinterpret_cast<const jchar*>(arguments[0]);
jsize size = arguments[1];
object a = 0;
object a = makeCharArray(t, size);
if (size) {
a = makeCharArray(t, size);
memcpy(&charArrayBody(t, a, 0), chars, size * sizeof(jchar));
}