[clang] [clang][ExprConst] Reject field access with nullptr base (PR #113885)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 28 17:17:01 PDT 2024


================
@@ -1703,7 +1703,7 @@ namespace {
     bool checkNullPointerDiagnosingWith(const GenDiagType &GenDiag) {
       if (Designator.Invalid)
         return false;
-      if (IsNullPtr) {
+      if (getLValueBase().isNull()) {
----------------
zygoloid wrote:

Why was the old check not good enough here? In the added testcase, `nb` is a null pointer.

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


More information about the cfe-commits mailing list