[PATCH] D77066: [analyzer] ApiModeling: Add buffer size arg constraint

Csaba Dabis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 31 13:44:43 PDT 2020


Charusso added a comment.

Please avoid to stuff in `CheckerContext` because this facility should be used by ExprEngine/Store as well.
Let us reword your API: `getDynamicSizeWithOffset(ProgramStateRef, SVal, SValBuilder &)`. Of course we are trying to obtain some buffer-ish size, that is the purpose of the entire API.
I also could imagine something like `getDynamicSizeMul(ProgramStateRef, const MemRegion &, const MemRegion &, SValBuilder &)`, as it is very common.

May it would make sense to use the API like:

  getDynamicSizeWithOffset(State, MR, SVB) {
    Offset = State->getStoreManager().getStaticOffset(MR, SVB);
    ...
  }

This idea is similar to `MemRegionManager::getStaticSize(MR, SVB)`. Hopefully no-one needs dynamic offsets.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77066/new/

https://reviews.llvm.org/D77066





More information about the cfe-commits mailing list