From f796502c057223b668ef36aa2b76a3f3019be875 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Wed, 24 May 2017 11:01:07 -0400 Subject: [PATCH] Backed out changeset 8401a2705903 (bug 1355046) for bug-1355046.js failures. --- js/src/frontend/BytecodeEmitter.cpp | 2 ++ js/src/frontend/BytecodeEmitter.h | 17 +++-------------- js/src/jit-test/tests/parser/bug-1355046.js | 6 ------ 3 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 js/src/jit-test/tests/parser/bug-1355046.js diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index a45bfc6ba53c..ba2d2e175f98 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -9134,6 +9134,8 @@ 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; } diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h index f238cc12c024..6c339d2b67aa 100644 --- a/js/src/frontend/BytecodeEmitter.h +++ b/js/src/frontend/BytecodeEmitter.h @@ -191,20 +191,9 @@ struct MOZ_STACK_CLASS BytecodeEmitter BytecodeVector code; /* bytecode */ SrcNotesVector notes; /* source notes, see below */ ptrdiff_t lastNoteOffset; /* code offset for last source note */ - - // 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; - + 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 */ JumpTarget lastTarget; // Last jump target emitted. EmitSection(JSContext* cx, uint32_t lineNum) diff --git a/js/src/jit-test/tests/parser/bug-1355046.js b/js/src/jit-test/tests/parser/bug-1355046.js deleted file mode 100644 index 33f307d9615c..000000000000 --- a/js/src/jit-test/tests/parser/bug-1355046.js +++ /dev/null @@ -1,6 +0,0 @@ -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);