[clang] [clang][dataflow] Fix crash on base-to-derived cast of unmodeled pointer value. (PR #179060)

Yitzhak Mandelbaum via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 4 10:12:31 PST 2026


================
@@ -328,9 +328,9 @@ class TransferVisitor : public ConstStmtVisitor<TransferVisitor> {
       RecordStorageLocation *Loc = nullptr;
       if (S->getType()->isPointerType()) {
         auto *PV = Env.get<PointerValue>(*SubExpr);
-        assert(PV != nullptr);
----------------
ymand wrote:

Why remove? My sense is that the intuition is that this situation shouldn't happen, but if it does we don't want to crash in release code, so we handle the case. But, we still want to find it in debug. If you think its correct to remove, please explain (that is, I understand it could be a mistake/left over, but would like that verified).

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


More information about the cfe-commits mailing list