Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion flang/lib/Parser/token-sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ void TokenSequence::clear() {

void TokenSequence::pop_back() {
CHECK(!start_.empty());
CHECK(nextStart_ > start_.back());
// If the last token is empty then `nextStart_ == start_.back()`.
CHECK(nextStart_ >= start_.back());
std::size_t bytes{nextStart_ - start_.back()};
nextStart_ = start_.back();
start_.pop_back();
Expand Down
5 changes: 5 additions & 0 deletions flang/test/Parser/issue-146362.1.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
! RUN: %flang_fc1 -fsyntax-only -cpp %s 2>&1
#define UNITY(k) 1_ ## k
PROGRAM REPRODUCER
WRITE(*,*) UNITY(4)
END PROGRAM REPRODUCER
Loading