MCPcopy Create free account
hub / github.com/R-Fuzz/symsan / getLoadedPointerBase

Function getLoadedPointerBase

instrumentation/UCSanPass.cpp:2378–2392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2376}
2377
2378static Value *getLoadedPointerBase(Value *Ptr, const DataLayout &DL,
2379 int64_t &AccessOffset) {
2380 Ptr = stripPointerCastsForSummary(Ptr);
2381 AccessOffset = 0;
2382
2383 if (auto *GEP = dyn_cast<GEPOperator>(Ptr)) {
2384 APInt APOffset(DL.getIndexSizeInBits(Ptr->getType()->getPointerAddressSpace()), 0);
2385 if (!GEP->accumulateConstantOffset(DL, APOffset))
2386 return nullptr;
2387 AccessOffset = APOffset.getSExtValue();
2388 Ptr = stripPointerCastsForSummary(GEP->getPointerOperand());
2389 }
2390
2391 return Ptr;
2392}
2393
2394void UCSanFunction::recordPointerLoadSummary(LoadInst &LI) {
2395 if (!LI.getType()->isPointerTy())

Callers 1

Calls 1

Tested by

no test coverage detected