Bug 505314: don't use LIR_ialloc with size 0, r=gal

This commit is contained in:
David Mandelin 2009-07-21 12:14:33 -07:00
parent 9b68c183a8
commit 8b13cd55dc
3 changed files with 5 additions and 3 deletions

View File

@ -8081,7 +8081,7 @@ TraceRecorder::record_JSOP_RETURN()
LIns* argsobj_ins = get(&cx->fp->argsobj);
LIns* length_ins = INS_CONST(cx->fp->argc);
LIns* callee_ins = get(&cx->fp->argv[-2]);
LIns* args_ins = lir->insAlloc(sizeof(jsval) * cx->fp->argc);
LIns* args_ins = cx->fp->argc ? lir->insAlloc(sizeof(jsval) * cx->fp->argc) : INS_CONSTPTR(0);
for (uintN i = 0; i < cx->fp->argc; ++i) {
LIns* arg_ins = get(&cx->fp->argv[i]);
box_jsval(cx->fp->argv[i], arg_ins);

View File

@ -619,8 +619,10 @@ namespace nanojit
asm_spilli(i, resv, pop);
_allocator.retire(rr); // free any register associated with entry
}
if (index)
if (index) {
NanoAssert(_activation.entry[index] == i);
arFree(index); // free any stack stack space associated with entry
}
i->resv()->clear();
}
@ -1602,7 +1604,6 @@ namespace nanojit
{
AR &ar = _activation;
LIns *i = ar.entry[idx];
NanoAssert(i != 0);
do {
ar.entry[idx] = 0;
idx--;

View File

@ -762,6 +762,7 @@ namespace nanojit
return out->insCall(call, args);
}
virtual LInsp insAlloc(int32_t size) {
NanoAssert(size != 0);
return out->insAlloc(size);
}
virtual LInsp insSkip(size_t size) {