@@ -49,7 +49,7 @@ static const Stmt *getStmtForDiagnostics(const ExplodedNode *N)
4949}
5050
5151// Turn on/off the log here
52- #define DEBUG_LOG 1
52+ #define DEBUG_LOG 0
5353
5454class GCChecker
5555 : public Checker<
@@ -1980,7 +1980,7 @@ void GCChecker::checkBind(SVal LVal, SVal RVal, const clang::Stmt *S,
19801980 } else {
19811981 logWithDump (" - Found ValState for Sym" , RValState);
19821982 validateValue (RValState, C, Sym, " Trying to root value which may have been" );
1983- if (!RValState->isRooted () ||
1983+ if (!RValState->isRooted () || !RValState-> isPinnedByAnyway () ||
19841984 RValState->RootDepth > RootState->RootedAtDepth ) {
19851985 auto NewVS = getRootedFromRegion (R, State->get <GCPinMap>(R), RootState->RootedAtDepth );
19861986 logWithDump (" - getRootedFromRegion" , NewVS);
@@ -2059,7 +2059,7 @@ void GCChecker::checkLocation(SVal SLoc, bool IsLoad, const Stmt *S,
20592059 const ValueState *ValS = State->get <GCValueMap>(LoadedSym);
20602060 logWithDump (" - IsLoad, LoadedSym" , LoadedSym);
20612061 logWithDump (" - IsLoad, ValS" , ValS);
2062- if (!ValS || !ValS->isRooted () || ValS->RootDepth > RS->RootedAtDepth ) {
2062+ if (!ValS || !ValS->isRooted () || !ValS-> isPinnedByAnyway () || ValS->RootDepth > RS->RootedAtDepth ) {
20632063 auto NewVS = getRootedFromRegion (SLoc.getAsRegion (), State->get <GCPinMap>(SLoc.getAsRegion ()), RS->RootedAtDepth );
20642064 logWithDump (" - IsLoad, NewVS" , NewVS);
20652065 DidChange = true ;
0 commit comments