[INFER] Fix bug in previous fix for bug 673341. r=bhackett

This commit is contained in:
Shu-yu Guo 2011-07-22 12:47:16 -07:00
parent 23065ac07b
commit 081b156d2e

View File

@ -864,26 +864,26 @@ ScriptAnalysis::analyzeLifetimes(JSContext *cx)
loop->lastBlock = offset; loop->lastBlock = offset;
if (code->exceptionEntry) { if (code->exceptionEntry) {
unsigned tryOffset = 0; bool found = false;
JSTryNote *tn = script->trynotes()->vector; JSTryNote *tn = script->trynotes()->vector;
JSTryNote *tnlimit = tn + script->trynotes()->length; JSTryNote *tnlimit = tn + script->trynotes()->length;
for (; tn < tnlimit; tn++) { for (; tn < tnlimit; tn++) {
unsigned startOffset = script->main - script->code + tn->start; unsigned startOffset = script->main - script->code + tn->start;
if (startOffset + tn->length == offset) { if (startOffset + tn->length == offset) {
tryOffset = startOffset - 1; /*
* Extend all live variables at exception entry to the start of
* the try block.
*/
for (unsigned i = 0; i < numSlots; i++) {
if (lifetimes[i].lifetime)
ensureVariable(lifetimes[i], startOffset - 1);
}
found = true;
break; break;
} }
JS_NOT_REACHED("Start of try block not found");
}
/*
* Extend all live variables at exception entry to the start of
* the try block.
*/
for (unsigned i = 0; i < numSlots; i++) {
if (lifetimes[i].lifetime)
ensureVariable(lifetimes[i], tryOffset);
} }
JS_ASSERT(found);
} }
switch (op) { switch (op) {