XDeme wrote:
> > While I was trying to find a minimal reproducer to the bug, I accidentally
> > found that this patch fix another crash, and doesn't fix the linked issue.
>
> Can you open another pull request to
> [fix](https://github.com/llvm/llvm-project/pull/77045#discussion_r1442578220)
>
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/77045
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> While I was trying to find a minimal reproducer to the bug, I accidentally
> found that this patch fix another crash, and doesn't fix the linked issue.
Can you open another pull request to
[fix](https://github.com/llvm/llvm-project/pull/77045#discussion_r1442578220)
the other
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/77045
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rymiel approved this pull request.
https://github.com/llvm/llvm-project/pull/77045
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/XDeme updated https://github.com/llvm/llvm-project/pull/77045
>From d9cbbe48b96d27bff3fc926b60d039ed05f00489 Mon Sep 17 00:00:00 2001
From: XDeme
Date: Fri, 5 Jan 2024 01:23:16 -0300
Subject: [PATCH 1/9] [clang-format] Fix crash involving array designators and
dangling comma
@@ -2315,6 +2315,8 @@ bool UnwrappedLineParser::tryToParseLambdaIntroducer() {
if (Next->is(tok::greater))
return false;
}
+ if (tok::isLiteral(FormatTok->Tok.getKind()))
+return false;
owenca wrote:
You are right! Then how about the following
https://github.com/XDeme edited https://github.com/llvm/llvm-project/pull/77045
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/XDeme updated https://github.com/llvm/llvm-project/pull/77045
>From d9cbbe48b96d27bff3fc926b60d039ed05f00489 Mon Sep 17 00:00:00 2001
From: XDeme
Date: Fri, 5 Jan 2024 01:23:16 -0300
Subject: [PATCH 1/8] [clang-format] Fix crash involving array designators and
dangling comma
@@ -2315,6 +2315,8 @@ bool UnwrappedLineParser::tryToParseLambdaIntroducer() {
if (Next->is(tok::greater))
return false;
}
+ if (tok::isLiteral(FormatTok->Tok.getKind()))
+return false;
XDeme wrote:
With this change, a code like this will cras
https://github.com/XDeme deleted https://github.com/llvm/llvm-project/pull/77045
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2315,6 +2315,8 @@ bool UnwrappedLineParser::tryToParseLambdaIntroducer() {
if (Next->is(tok::greater))
return false;
}
+ if (tok::isLiteral(FormatTok->Tok.getKind()))
+return false;
XDeme wrote:
With this change this code will crash:
```cp
owenca wrote:
Please add an assertion in `WhitespaceManager.h`:
```
--- a/clang/lib/Format/WhitespaceManager.h
+++ b/clang/lib/Format/WhitespaceManager.h
@@ -282,6 +282,7 @@ private:
for (auto PrevIter = Start; PrevIter != End; ++PrevIter) {
// If we broke the line the initial spaces
@@ -2315,6 +2315,8 @@ bool UnwrappedLineParser::tryToParseLambdaIntroducer() {
if (Next->is(tok::greater))
return false;
}
+ if (tok::isLiteral(FormatTok->Tok.getKind()))
+return false;
owenca wrote:
```suggestion
```
Instead, I would change l
https://github.com/XDeme updated https://github.com/llvm/llvm-project/pull/77045
>From d9cbbe48b96d27bff3fc926b60d039ed05f00489 Mon Sep 17 00:00:00 2001
From: XDeme
Date: Fri, 5 Jan 2024 01:23:16 -0300
Subject: [PATCH 1/7] [clang-format] Fix crash involving array designators and
dangling comma
@@ -2315,6 +2315,10 @@ bool UnwrappedLineParser::tryToParseLambdaIntroducer() {
if (Next->is(tok::greater))
return false;
}
+ if (const auto Kind = FormatTok->Tok.getKind();
+ tok::isLiteral(Kind) && !tok::isStringLiteral(Kind)) {
HazardyKnusp
@@ -1444,6 +1444,7 @@ WhitespaceManager::CellDescriptions
WhitespaceManager::getCells(unsigned Start,
} else if (C.Tok->is(tok::comma)) {
if (!Cells.empty())
Cells.back().EndIndex = i;
+
HazardyKnusperkeks wrote:
Unrelated (and unwante
https://github.com/XDeme edited https://github.com/llvm/llvm-project/pull/77045
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/XDeme edited https://github.com/llvm/llvm-project/pull/77045
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
19 matches
Mail list logo