@@ -49,7 +49,7 @@ static const Stmt *getStmtForDiagnostics(const ExplodedNode *N)
49
49
}
50
50
51
51
// Turn on/off the log here
52
- #define DEBUG_LOG 1
52
+ #define DEBUG_LOG 0
53
53
54
54
class GCChecker
55
55
: public Checker<
@@ -1980,7 +1980,7 @@ void GCChecker::checkBind(SVal LVal, SVal RVal, const clang::Stmt *S,
1980
1980
} else {
1981
1981
logWithDump (" - Found ValState for Sym" , RValState);
1982
1982
validateValue (RValState, C, Sym, " Trying to root value which may have been" );
1983
- if (!RValState->isRooted () ||
1983
+ if (!RValState->isRooted () || !RValState-> isPinnedByAnyway () ||
1984
1984
RValState->RootDepth > RootState->RootedAtDepth ) {
1985
1985
auto NewVS = getRootedFromRegion (R, State->get <GCPinMap>(R), RootState->RootedAtDepth );
1986
1986
logWithDump (" - getRootedFromRegion" , NewVS);
@@ -2059,7 +2059,7 @@ void GCChecker::checkLocation(SVal SLoc, bool IsLoad, const Stmt *S,
2059
2059
const ValueState *ValS = State->get <GCValueMap>(LoadedSym);
2060
2060
logWithDump (" - IsLoad, LoadedSym" , LoadedSym);
2061
2061
logWithDump (" - IsLoad, ValS" , ValS);
2062
- if (!ValS || !ValS->isRooted () || ValS->RootDepth > RS->RootedAtDepth ) {
2062
+ if (!ValS || !ValS->isRooted () || !ValS-> isPinnedByAnyway () || ValS->RootDepth > RS->RootedAtDepth ) {
2063
2063
auto NewVS = getRootedFromRegion (SLoc.getAsRegion (), State->get <GCPinMap>(SLoc.getAsRegion ()), RS->RootedAtDepth );
2064
2064
logWithDump (" - IsLoad, NewVS" , NewVS);
2065
2065
DidChange = true ;
0 commit comments