[PATCH] D135356: [Format] Fix crash when hitting eof while lexing JS template string

2022-10-06 Thread Gulfem Savrun Yeniceri via Phabricator via cfe-commits
gulfem added a comment. In D135356#3840428 , @sammccall wrote: > Fixed by 4b53c00173163774d32125fbcae283a46a9a4b19 > I think. It fixed the test error that we are seeing, thanks! Rep

[PATCH] D135356: [Format] Fix crash when hitting eof while lexing JS template string

2022-10-06 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Fixed by 4b53c00173163774d32125fbcae283a46a9a4b19 I think. (@kadircet suggested a possible second crash, I couldn't get it to crash so included the testcase with this patch. Turns out it does crash.

[PATCH] D135356: [Format] Fix crash when hitting eof while lexing JS template string

2022-10-06 Thread Gulfem Savrun Yeniceri via Phabricator via cfe-commits
gulfem added a comment. We are seeing the same error reported above: FormatTests: clang/lib/Lex/Lexer.cpp:1151: SourceLocation clang::Lexer::getSourceLocation(const char *, unsigned int) const: Assertion `Loc >= BufferStart && Loc <= BufferEnd && "Location out of range for this buffer!"' fai

[PATCH] D135356: [Format] Fix crash when hitting eof while lexing JS template string

2022-10-06 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. This breaks tests: http://45.33.8.238/linux/88341/step_7.txt Please take a look and revert for now if it takes a while to fix. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135356/new/ https://reviews.llvm.org/D135356

[PATCH] D135356: [Format] Fix crash when hitting eof while lexing JS template string

2022-10-06 Thread Sam McCall via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG882a05afa17f: [Format] Fix crash when hitting eof while lexing JS template string (authored by sammccall). Changed prior to commit: https://review

[PATCH] D135356: [Format] Fix crash when hitting eof while lexing JS template string

2022-10-06 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked an inline comment as done. sammccall added inline comments. Comment at: clang/lib/Format/FormatTokenLexer.cpp:767 if (Offset[0] == '\\') { ++Offset; // Skip the escaped character. } else if (Offset + 1 < Lex->getBuffer().end() && Offset[0] == '$'

[PATCH] D135356: [Format] Fix crash when hitting eof while lexing JS template string

2022-10-06 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. thanks! Comment at: clang/lib/Format/FormatTokenLexer.cpp:767 if (Offset[0] == '\\') { ++Offset; // Skip the escaped character. } else if (Offset + 1 < L

[PATCH] D135356: [Format] Fix crash when hitting eof while lexing JS template string

2022-10-06 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: kadircet. Herald added a project: All. sammccall requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Different loop termination conditions resulted in confusion of whether *Offset was