From 2b4e577d8e13bc6cfef44bc4978d182407063db5 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 19 Sep 2024 19:04:22 +0200 Subject: [PATCH] No issue - Fix asserts in debug. Hashbang parser changes allow more than one EOL which screws up these assertions' premise. Just remove them as the preconditions are no longer valid. --- js/src/frontend/TokenStream.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp index cd0e1b29e4..0130b20abc 100644 --- a/js/src/frontend/TokenStream.cpp +++ b/js/src/frontend/TokenStream.cpp @@ -362,10 +362,7 @@ TokenStream::SourceCoords::add(uint32_t lineNum, uint32_t lineStartOffset) lineStartOffsets_[lineIndex] = lineStartOffset; } else { - // We have seen this newline before (and ungot it). Do nothing (other - // than checking it hasn't mysteriously changed). - // This path can be executed after hitting OOM, so check lineIndex. - MOZ_ASSERT_IF(lineIndex < sentinelIndex, lineStartOffsets_[lineIndex] == lineStartOffset); + // We have seen this newline before (and ungot it). Do nothing. } return true; } @@ -615,7 +612,6 @@ TokenStream::ungetChar(int32_t c) if (!userbuf.atStart()) userbuf.matchRawCharBackwards('\r'); - MOZ_ASSERT(prevLinebase != size_t(-1)); // we should never get more than one EOL char linebase = prevLinebase; prevLinebase = size_t(-1); lineno--;