Index: lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp +++ lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp @@ -213,6 +213,8 @@ if (const auto *ICall = dyn_cast(&Call)) { 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(); +}