================
@@ -231,16 +265,22 @@ class StdVariantChecker : public Checker<eval::Call, 
check::RegionChanges> {
     // Get the mem region of the argument std::variant and look up the type
     // information that we know about it.
     const MemRegion *ArgMemRegion = Call.getArgSVal(0).getAsRegion();
-    const QualType *StoredType = State->get<VariantHeldTypeMap>(ArgMemRegion);
-    if (!StoredType)
+    const SVal *StoredSVal = State->get<VariantHeldMap>(ArgMemRegion);
+    if (!StoredSVal)
+      return false;
+
+    QualType RefStoredType = StoredSVal->getType(C.getASTContext());
+
+    if (RefStoredType->getPointeeType().isNull())
       return false;
+    QualType StoredType = RefStoredType->getPointeeType();
----------------
NagyDonat wrote:

```suggestion
    QualType StoredType = RefStoredType->getPointeeType();
    if (StoredType.isNull())
      return false;
```

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

Reply via email to