================
@@ -63,11 +62,39 @@ void FixedAddressChecker::checkPreStmt(const BinaryOperator 
*B,
         "Using a fixed address is not portable because that address will "
         "probably not be valid in all environments or platforms.";
     auto R = std::make_unique<PathSensitiveBugReport>(BT, Msg, N);
-    R->addRange(B->getRHS()->getSourceRange());
+    R->addRange(SrcExpr->getSourceRange());
     C.emitReport(std::move(R));
   }
 }
 
+void FixedAddressChecker::checkPreStmt(const BinaryOperator *B,
+                                       CheckerContext &C) const {
+  if (B->getOpcode() != BO_Assign)
+    return;
+
+  checkUseOfFixedAddress(B->getType(), B->getRHS(), C);
+}
+
+void FixedAddressChecker::checkPreStmt(const DeclStmt *D,
+                                       CheckerContext &C) const {
+  for (const auto *D1 : D->decls()) {
----------------
steakhal wrote:

But "D" is already singular. And eventually we reach the second, thirds, etc 
decls too. In which case number 1 would confuse me, because its not only the 
first one.

https://github.com/llvm/llvm-project/pull/110977
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to