Make sure to allocate auxiliary PC counter arrays when required, bug 721274. r=dvander

This commit is contained in:
Brian Hackett 2012-02-28 08:00:24 -08:00
parent 5cc903166e
commit 11539a30d5

View File

@ -536,6 +536,14 @@ mjit::Compiler::performCompilation()
if (inlining())
CHECK_STATUS(scanInlineCalls(CrossScriptSSA::OUTER_FRAME, 0));
CHECK_STATUS(pushActiveFrame(outerScript, 0));
if (outerScript->pcCounters || Probes::wantNativeAddressInfo(cx)) {
size_t length = ssa.frameLength(ssa.numFrames() - 1);
pcLengths = (PCLengthEntry *) OffTheBooks::calloc_(sizeof(pcLengths[0]) * length);
if (!pcLengths)
return Compile_Error;
}
if (chunkIndex == 0)
CHECK_STATUS(generatePrologue());
CHECK_STATUS(generateMethod());
@ -1191,13 +1199,6 @@ mjit::Compiler::generatePrologue()
recompileCheckHelper();
if (outerScript->pcCounters || Probes::wantNativeAddressInfo(cx)) {
size_t length = ssa.frameLength(ssa.numFrames() - 1);
pcLengths = (PCLengthEntry *) OffTheBooks::calloc_(sizeof(pcLengths[0]) * length);
if (!pcLengths)
return Compile_Error;
}
return Compile_Okay;
}