@@ -1596,7 +1596,7 @@ static auto computeNewlines(const AnnotatedLine &Line,
if (Line.startsWith(TT_NamespaceRBrace)) {
if (Style.WrapNamespaceBodyWithEmptyLines == FormatStyle::WNBWELS_Never)
Newlines = 1;
- else if (!PreviousLine->startsWith(TT_Namespac
@@ -1596,7 +1596,7 @@ static auto computeNewlines(const AnnotatedLine &Line,
if (Line.startsWith(TT_NamespaceRBrace)) {
if (Style.WrapNamespaceBodyWithEmptyLines == FormatStyle::WNBWELS_Never)
Newlines = 1;
- else if (!PreviousLine->startsWith(TT_Namespac
owenca wrote:
@hstk30-hw please add a test case that would cause a crash without your patch.
https://github.com/llvm/llvm-project/pull/126872
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co
https://github.com/schittir closed
https://github.com/llvm/llvm-project/pull/126872
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hstk30-hw approved this pull request.
https://github.com/llvm/llvm-project/pull/126872
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-clang-format
Author: None (schittir)
Changes
Add a null check.
---
Full diff: https://github.com/llvm/llvm-project/pull/126872.diff
1 Files Affected:
- (modified) clang/lib/Format/UnwrappedLineFormatter.cpp (+1-1)
``diff
diff --git a/clang
https://github.com/schittir created
https://github.com/llvm/llvm-project/pull/126872
Add a null check.
>From 5a25d2a34813d7b37a0a26cd883c6a7ccd4574a8 Mon Sep 17 00:00:00 2001
From: Sindhu Chittireddy
Date: Wed, 12 Feb 2025 00:05:33 -0800
Subject: [PATCH] [NFC] Avoid potential null dereference.