File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed
clang/lib/StaticAnalyzer/Checkers Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -427,21 +427,6 @@ static std::optional<NonLoc> getIndex(ProgramStateRef State,
427
427
return Offset.castAs <NonLoc>();
428
428
}
429
429
430
- // Try to get hold of the origin region (e.g. the actual array region from an
431
- // element region).
432
- static const TypedValueRegion *getOriginRegion (const ElementRegion *ER) {
433
- const MemRegion *MR = ER->getSuperRegion ();
434
- const MemRegion *Ret = MR;
435
- assert (MR);
436
- if (const auto *sym = MR->getAs <SymbolicRegion>()) {
437
- SymbolRef sym2 = sym->getSymbol ();
438
- if (!sym2)
439
- return nullptr ;
440
- Ret = sym2->getOriginRegion ();
441
- }
442
- return dyn_cast_or_null<TypedValueRegion>(Ret);
443
- }
444
-
445
430
// Basically 1 -> 1st, 12 -> 12th, etc.
446
431
static void printIdxWithOrdinalSuffix (llvm::raw_ostream &Os, unsigned Idx) {
447
432
Os << Idx << llvm::getOrdinalSuffix (Idx);
@@ -461,7 +446,7 @@ ProgramStateRef CStringChecker::checkInit(CheckerContext &C,
461
446
if (!ER)
462
447
return State;
463
448
464
- const TypedValueRegion *Orig = getOriginRegion (ER );
449
+ const auto *Orig = ER-> getSuperRegion ()-> getAs <TypedValueRegion>( );
465
450
if (!Orig)
466
451
return State;
467
452
You can’t perform that action at this time.
0 commit comments