[llvm] DiagnosticInfo: Fix stack-use-after-scope in DiagnosticInfoStackSize (PR #190442)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 3 20:46:18 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h -- llvm/include/llvm/IR/DiagnosticInfo.h --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/IR/DiagnosticInfo.h b/llvm/include/llvm/IR/DiagnosticInfo.h
index 189a8775a..097c2704d 100644
--- a/llvm/include/llvm/IR/DiagnosticInfo.h
+++ b/llvm/include/llvm/IR/DiagnosticInfo.h
@@ -507,8 +507,8 @@ public:
DiagnosticInfoStackSize(const Function &Fn, uint64_t StackSize,
uint64_t StackLimit,
DiagnosticSeverity Severity = DS_Warning)
- : DiagnosticInfoResourceLimit(Fn, ResourceName, StackSize,
- StackLimit, Severity, DK_StackSize) {}
+ : DiagnosticInfoResourceLimit(Fn, ResourceName, StackSize, StackLimit,
+ Severity, DK_StackSize) {}
uint64_t getStackSize() const { return getResourceSize(); }
uint64_t getStackLimit() const { return getResourceLimit(); }
``````````
</details>
https://github.com/llvm/llvm-project/pull/190442
More information about the llvm-commits
mailing list