| 2376 | } |
| 2377 | |
| 2378 | static 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 | |
| 2394 | void UCSanFunction::recordPointerLoadSummary(LoadInst &LI) { |
| 2395 | if (!LI.getType()->isPointerTy()) |
no test coverage detected