fix #447: leak in compile.cpp (thanks, @mretallack!)

This commit is contained in:
Joshua Warner 2015-07-18 08:44:15 -06:00 committed by Joel Dice
parent b766193966
commit 82fd3a8dcb

View File

@ -7030,9 +7030,9 @@ void compile(MyThread* t, Context* context)
c->restoreState(state); c->restoreState(state);
ir::Type* stackMap = (ir::Type*)malloc( ir::Type* stackMap2 = (ir::Type*)malloc(
sizeof(ir::Type) * context->method->code()->maxStack()); sizeof(ir::Type) * context->method->code()->maxStack());
Frame frame2(&frame, stackMap); Frame frame2(&frame, stackMap2);
unsigned end = duplicatedBaseIp + exceptionHandlerEnd(eh); unsigned end = duplicatedBaseIp + exceptionHandlerEnd(eh);
if (exceptionHandlerIp(eh) >= static_cast<unsigned>(start) if (exceptionHandlerIp(eh) >= static_cast<unsigned>(start)
@ -7053,6 +7053,7 @@ void compile(MyThread* t, Context* context)
context->eventLog.append(PopContextEvent); context->eventLog.append(PopContextEvent);
eventIndex = calculateFrameMaps(t, context, 0, eventIndex, 0); eventIndex = calculateFrameMaps(t, context, 0, eventIndex, 0);
free(stackMap2);
} }
} }
} }