Loading js/src/frontend/SourceNotes.h +11 −1 Original line number Diff line number Diff line Loading @@ -80,6 +80,16 @@ class SrcNote { Count }; }; // SRC_COLSPAN: Source note for arbitrary ops. class ColSpan { public: enum Fields { // The column span (the diff between the column corresponds to the // current op and last known column). Span, Count }; }; }; #define FOR_EACH_SRC_NOTE_TYPE(M) \ Loading @@ -106,7 +116,7 @@ class SrcNote { for toString correctness for default ctors. */ \ M(SRC_TRY, "try", SrcNote::Try::Count) \ /* All notes above here are "gettable". See SN_IS_GETTABLE below. */ \ M(SRC_COLSPAN, "colspan", 1) /* Number of columns this opcode spans. */ \ M(SRC_COLSPAN, "colspan", SrcNote::ColSpan::Count) \ M(SRC_NEWLINE, "newline", 0) /* Bytecode follows a source newline. */ \ M(SRC_SETLINE, "setline", 1) /* A file-absolute source line number note. */ \ M(SRC_UNUSED21, "unused21", 0) /* Unused. */ \ Loading js/src/shell/js.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -2725,7 +2725,7 @@ SrcNotes(JSContext* cx, HandleScript script, Sprinter* sp) break; case SRC_COLSPAN: colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, 0)); colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, SrcNote::ColSpan::Span)); if (!sp->jsprintf("%d", colspan)) return false; break; Loading js/src/vm/BytecodeUtil-inl.h +2 −1 Original line number Diff line number Diff line Loading @@ -178,7 +178,8 @@ class BytecodeRangeWithPosition : private BytecodeRange while (!SN_IS_TERMINATOR(sn) && snpc <= frontPC()) { SrcNoteType type = SN_TYPE(sn); if (type == SRC_COLSPAN) { ptrdiff_t colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, 0)); ptrdiff_t colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, SrcNote::ColSpan::Span)); MOZ_ASSERT(ptrdiff_t(column) + colspan >= 0); column += colspan; lastLinePC = snpc; Loading js/src/vm/JSScript.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -3277,7 +3277,7 @@ js::PCToLineNumber(unsigned startLine, jssrcnote* notes, jsbytecode* code, jsbyt lineno++; column = 0; } else if (type == SRC_COLSPAN) { ptrdiff_t colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, 0)); ptrdiff_t colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, SrcNote::ColSpan::Span)); MOZ_ASSERT(ptrdiff_t(column) + colspan >= 0); column += colspan; } Loading Loading
js/src/frontend/SourceNotes.h +11 −1 Original line number Diff line number Diff line Loading @@ -80,6 +80,16 @@ class SrcNote { Count }; }; // SRC_COLSPAN: Source note for arbitrary ops. class ColSpan { public: enum Fields { // The column span (the diff between the column corresponds to the // current op and last known column). Span, Count }; }; }; #define FOR_EACH_SRC_NOTE_TYPE(M) \ Loading @@ -106,7 +116,7 @@ class SrcNote { for toString correctness for default ctors. */ \ M(SRC_TRY, "try", SrcNote::Try::Count) \ /* All notes above here are "gettable". See SN_IS_GETTABLE below. */ \ M(SRC_COLSPAN, "colspan", 1) /* Number of columns this opcode spans. */ \ M(SRC_COLSPAN, "colspan", SrcNote::ColSpan::Count) \ M(SRC_NEWLINE, "newline", 0) /* Bytecode follows a source newline. */ \ M(SRC_SETLINE, "setline", 1) /* A file-absolute source line number note. */ \ M(SRC_UNUSED21, "unused21", 0) /* Unused. */ \ Loading
js/src/shell/js.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -2725,7 +2725,7 @@ SrcNotes(JSContext* cx, HandleScript script, Sprinter* sp) break; case SRC_COLSPAN: colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, 0)); colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, SrcNote::ColSpan::Span)); if (!sp->jsprintf("%d", colspan)) return false; break; Loading
js/src/vm/BytecodeUtil-inl.h +2 −1 Original line number Diff line number Diff line Loading @@ -178,7 +178,8 @@ class BytecodeRangeWithPosition : private BytecodeRange while (!SN_IS_TERMINATOR(sn) && snpc <= frontPC()) { SrcNoteType type = SN_TYPE(sn); if (type == SRC_COLSPAN) { ptrdiff_t colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, 0)); ptrdiff_t colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, SrcNote::ColSpan::Span)); MOZ_ASSERT(ptrdiff_t(column) + colspan >= 0); column += colspan; lastLinePC = snpc; Loading
js/src/vm/JSScript.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -3277,7 +3277,7 @@ js::PCToLineNumber(unsigned startLine, jssrcnote* notes, jsbytecode* code, jsbyt lineno++; column = 0; } else if (type == SRC_COLSPAN) { ptrdiff_t colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, 0)); ptrdiff_t colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, SrcNote::ColSpan::Span)); MOZ_ASSERT(ptrdiff_t(column) + colspan >= 0); column += colspan; } Loading