================ @@ -1222,6 +1222,15 @@ void ExprEngine::ProcessInitializer(const CFGInitializer CFGInit, PostInitializer PP(BMI, FieldLoc.getAsRegion(), stackFrame); evalBind(Tmp, Init, Pred, FieldLoc, InitVal, /*isInit=*/true, &PP); } + } else if (BMI->isBaseInitializer() && isa<InitListExpr>(Init)) { + // When the base class is initialized with an initialization list, there + // will not be a CXXConstructExpr to initialize the base region. Hence, we + // need to make the bind for it. + StoreManager &StoreMgr = State->getStateManager().getStoreManager(); + SVal BaseLoc = StoreMgr.evalDerivedToBase( + thisVal, QualType(BMI->getBaseClass(), 0), BMI->isBaseVirtual()); + SVal InitVal = State->getSVal(Init, stackFrame); + evalBind(Tmp, Init, Pred, BaseLoc, InitVal, true); ---------------- steakhal wrote:
BTW I can see that in the neighborhood, we also pass a `PostInitializer PP` as the last argument of `evalBind`. Why don't you do the same here? To me, we should deal with the same "event"/program point here as everywhere in this function. Maybe hoist `PostInitializer PP(BMI, FieldLoc.getAsRegion(), stackFrame);` and use `PP` everywhere. https://github.com/llvm/llvm-project/pull/70792 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits