use THREAD_RUNTIME_ARRAY instead of RUNTIME_ARRAY where appropriate

This ensures that if the stack is unwound for an exception we'll still
release the memory.
This commit is contained in:
Joel Dice
2013-02-05 10:13:59 -07:00
parent f2d2c9af29
commit d97fe5304f
2 changed files with 6 additions and 6 deletions

View File

@ -647,7 +647,7 @@ invokeNative(Thread* t, object method)
{ THREAD_RESOURCE0(t, popFrame(static_cast<Thread*>(t)));
unsigned footprint = methodParameterFootprint(t, method);
RUNTIME_ARRAY(uintptr_t, args, footprint);
THREAD_RUNTIME_ARRAY(t, uintptr_t, args, footprint);
unsigned sp = frameBase(t, t->frame);
unsigned argOffset = 0;
if ((methodFlags(t, method) & ACC_STATIC) == 0) {
@ -2321,7 +2321,7 @@ interpret3(Thread* t, const int base)
object class_ = resolveClassInPool(t, frameMethod(t, frame), index - 1);
PROTECT(t, class_);
RUNTIME_ARRAY(int32_t, counts, dimensions);
THREAD_RUNTIME_ARRAY(t, int32_t, counts, dimensions);
for (int i = dimensions - 1; i >= 0; --i) {
counts[i] = popInt(t);
if (UNLIKELY(counts[i] < 0)) {