Index: lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp +++ lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp @@ -211,8 +211,11 @@ ProgramStateRef State = C.getState(); if (const auto *ICall = dyn_cast(&Call)) { + // TODO: Do we need these to be typed? const auto *ObjRegion = dyn_cast_or_null( ICall->getCXXThisVal().getAsRegion()); + if (!ObjRegion) + return; if (Call.isCalled(CStrFn) || Call.isCalled(DataFn)) { SVal RawPtr = Call.getReturnValue(); Index: test/Analysis/inner-pointer.cpp =================================================================== --- test/Analysis/inner-pointer.cpp +++ test/Analysis/inner-pointer.cpp @@ -424,3 +424,7 @@ *(void **)&b = c() + 1; *b = a; // no-crash } + +void checkReference(std::string &s) { + const char *c = s.c_str(); +}