예제 #1
0
ProgramStateRef
ProgramState::invalidateRegionsImpl(ValueList Values,
                                    const Expr *E, unsigned Count,
                                    const LocationContext *LCtx,
                                    bool CausedByPointerEscape,
                                    InvalidatedSymbols &IS,
                                    const CallEvent *Call,
                                    ValueList ConstValues) const {
  ProgramStateManager &Mgr = getStateManager();
  SubEngine* Eng = Mgr.getOwningEngine();
  InvalidatedSymbols ConstIS;

  if (Eng) {
    StoreManager::InvalidatedRegions TopLevelInvalidated;
    StoreManager::InvalidatedRegions TopLevelConstInvalidated;
    StoreManager::InvalidatedRegions Invalidated;
    const StoreRef &newStore
    = Mgr.StoreMgr->invalidateRegions(getStore(), Values, ConstValues,
                                      E, Count, LCtx, Call,
                                      IS, ConstIS,
                                      &TopLevelInvalidated,
                                      &TopLevelConstInvalidated,
                                      &Invalidated);

    ProgramStateRef newState = makeWithStore(newStore);

    if (CausedByPointerEscape) {
      newState = Eng->notifyCheckersOfPointerEscape(newState, &IS,
                                                    TopLevelInvalidated,
                                                    Invalidated, Call);
      if (!ConstValues.empty()) {
        StoreManager::InvalidatedRegions Empty;
        newState = Eng->notifyCheckersOfPointerEscape(newState, &ConstIS,
                                                      TopLevelConstInvalidated,
                                                      Empty, Call,
                                                      true);
      }
    }

    return Eng->processRegionChanges(newState, &IS,
                                     TopLevelInvalidated, Invalidated,
                                     Call);
  }

  const StoreRef &newStore =
  Mgr.StoreMgr->invalidateRegions(getStore(), Values, ConstValues,
                                  E, Count, LCtx, Call,
                                  IS, ConstIS, NULL, NULL, NULL);
  return makeWithStore(newStore);
}
예제 #2
0
ProgramStateRef
ProgramState::invalidateRegionsImpl(ValueList Values,
                                    const Expr *E, unsigned Count,
                                    const LocationContext *LCtx,
                                    bool CausedByPointerEscape,
                                    InvalidatedSymbols *IS,
                                    RegionAndSymbolInvalidationTraits *ITraits,
                                    const CallEvent *Call) const {
    ProgramStateManager &Mgr = getStateManager();
    SubEngine* Eng = Mgr.getOwningEngine();

    InvalidatedSymbols Invalidated;
    if (!IS)
        IS = &Invalidated;

    RegionAndSymbolInvalidationTraits ITraitsLocal;
    if (!ITraits)
        ITraits = &ITraitsLocal;

    if (Eng) {
        StoreManager::InvalidatedRegions TopLevelInvalidated;
        StoreManager::InvalidatedRegions Invalidated;
        const StoreRef &newStore
            = Mgr.StoreMgr->invalidateRegions(getStore(), Values, E, Count, LCtx, Call,
                                              *IS, *ITraits, &TopLevelInvalidated,
                                              &Invalidated);

        ProgramStateRef newState = makeWithStore(newStore);

        if (CausedByPointerEscape) {
            newState = Eng->notifyCheckersOfPointerEscape(newState, IS,
                       TopLevelInvalidated,
                       Invalidated, Call,
                       *ITraits);
        }

        return Eng->processRegionChanges(newState, IS, TopLevelInvalidated,
                                         Invalidated, Call);
    }

    const StoreRef &newStore =
        Mgr.StoreMgr->invalidateRegions(getStore(), Values, E, Count, LCtx, Call,
                                        *IS, *ITraits, nullptr, nullptr);
    return makeWithStore(newStore);
}