[clang] [Clang] Optimize -Wunsafe-buffer-usage. (PR #125492)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 3 07:06:05 PST 2025


================
@@ -1189,29 +1355,40 @@ class PointerArithmeticGadget : public WarningGadget {
   const Expr *Ptr;          // the pointer expression in `PA`
 
 public:
-  PointerArithmeticGadget(const MatchFinder::MatchResult &Result)
+  PointerArithmeticGadget(const MatchResult &Result)
       : WarningGadget(Kind::PointerArithmetic),
-        PA(Result.Nodes.getNodeAs<BinaryOperator>(PointerArithmeticTag)),
-        Ptr(Result.Nodes.getNodeAs<Expr>(PointerArithmeticPointerTag)) {}
+        PA((Result.getNodeAs<BinaryOperator>(PointerArithmeticTag))),
----------------
ilya-biryukov wrote:

NIT: one pair of parentheses seems redundant

https://github.com/llvm/llvm-project/pull/125492


More information about the cfe-commits mailing list