This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd5be1550f140: [clang-format] Don't crash on malformed
preprocessor conditions (authored by sstwcw).
Changed prior to commit:
https://reviews.llvm.
owenpan accepted this revision.
owenpan added inline comments.
This revision is now accepted and ready to land.
Comment at: clang/unittests/Format/FormatTest.cpp:5209
+ verifyNoCrash("#if X\n"
+"#else\n"
+"#else\n"
`#elif Y` inste
sstwcw marked 3 inline comments as done.
sstwcw added inline comments.
Comment at: clang/unittests/Format/FormatTest.cpp:5196-5206
+ std::function FormatBadBranches =
+ [&](std::string Prefix, unsigned Lines) {
+const std::string Directives[] = {"", "#if X\n", "#els
sstwcw updated this revision to Diff 470623.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135972/new/
https://reviews.llvm.org/D135972
Files:
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp
Index: clang/unittest
owenpan added inline comments.
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1217
+ assert(PPBranchLevel >= -1);
+ if (PPBranchLevel <= -1)
+conditionalCompilationStart(/*Unreachable=*/true);
HazardyKnusperkeks wrote:
> You assert >= -1, that means t
HazardyKnusperkeks added inline comments.
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1217
+ assert(PPBranchLevel >= -1);
+ if (PPBranchLevel <= -1)
+conditionalCompilationStart(/*Unreachable=*/true);
You assert >= -1, that means this has to be ==
sstwcw marked 2 inline comments as done.
sstwcw added inline comments.
Comment at: clang/unittests/Format/FormatTest.cpp:5196-5206
+ std::function FormatBadBranches =
+ [&](std::string Prefix, unsigned Lines) {
+const std::string Directives[] = {"", "#if X\n", "#els
sstwcw updated this revision to Diff 470015.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135972/new/
https://reviews.llvm.org/D135972
Files:
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp
Index: clang/unittest
owenpan added inline comments.
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1216
+ // Don't crash when there is an #else without an #if.
+ if (PPBranchLevel <= -1) {
+conditionalCompilationStart(/*Unreachable=*/true);
Nit.
Comment
sstwcw updated this revision to Diff 467832.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135972/new/
https://reviews.llvm.org/D135972
Files:
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp
Index: clang/unittest
sstwcw created this revision.
sstwcw added reviewers: HazardyKnusperkeks, MyDeveloperDay, curdeius, owenpan.
sstwcw added a project: clang-format.
Herald added a project: All.
sstwcw requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Previousl
11 matches
Mail list logo