зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1355046 - Don't reset column and line info when emitting useless statements in BCE. (r=jorendorff)
This commit is contained in:
Родитель
cf9c954c8d
Коммит
92f3250d75
|
@ -9134,8 +9134,6 @@ BytecodeEmitter::emitStatement(ParseNode* pn)
|
|||
return false;
|
||||
}
|
||||
} else {
|
||||
current->currentLine = parser.tokenStream().srcCoords.lineNum(pn2->pn_pos.begin);
|
||||
current->lastColumn = 0;
|
||||
if (!reportExtraWarning(pn2, JSMSG_USELESS_EXPR))
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -191,9 +191,20 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
|||
BytecodeVector code; /* bytecode */
|
||||
SrcNotesVector notes; /* source notes, see below */
|
||||
ptrdiff_t lastNoteOffset; /* code offset for last source note */
|
||||
uint32_t currentLine; /* line number for tree-based srcnote gen */
|
||||
uint32_t lastColumn; /* zero-based column index on currentLine of
|
||||
last SRC_COLSPAN-annotated opcode */
|
||||
|
||||
// Line number for srcnotes.
|
||||
//
|
||||
// WARNING: If this becomes out of sync with already-emitted srcnotes,
|
||||
// we can get undefined behavior.
|
||||
uint32_t currentLine;
|
||||
|
||||
// Zero-based column index on currentLine of last SRC_COLSPAN-annotated
|
||||
// opcode.
|
||||
//
|
||||
// WARNING: If this becomes out of sync with already-emitted srcnotes,
|
||||
// we can get undefined behavior.
|
||||
uint32_t lastColumn;
|
||||
|
||||
JumpTarget lastTarget; // Last jump target emitted.
|
||||
|
||||
EmitSection(JSContext* cx, uint32_t lineNum)
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// |jit-test| error: ReferenceError
|
||||
|
||||
var localstr = "";
|
||||
for (var i = 0; i < 0xFFFC; ++i)
|
||||
localstr += ('\f') + i + "; ";
|
||||
var arg = "x";
|
||||
var body = localstr + "for (var i = 0; i < 4; ++i) arr[i](x-1);";
|
||||
(new Function(arg, body))(1000);
|
Загрузка…
Ссылка в новой задаче