diff --git a/src/clangsa/GCChecker.cpp b/src/clangsa/GCChecker.cpp index e6dc76353e8b0..58ad3714e1b27 100644 --- a/src/clangsa/GCChecker.cpp +++ b/src/clangsa/GCChecker.cpp @@ -505,7 +505,7 @@ void GCChecker::validateValue(const ValueState* VS, CheckerContext &C, SymbolRef int GCChecker::validateValueInner(const ValueState* VS) const { if (!VS) return VALID; - + if (VS->isPotentiallyFreed()) { return FREED; } @@ -563,7 +563,7 @@ void GCChecker::logWithDump(const std::string& message, const T &obj) { void GCChecker::log(const std::string& message) { if (!DEBUG_LOG) return; - + llvm::errs() << message; llvm::errs() << "\n"; } @@ -1625,7 +1625,7 @@ void GCChecker::checkPreCall(const CallEvent &Call, CheckerContext &C) const { C, Sym, "Passing non-rooted value as argument to function that may GC", range); - } + } } if (ValState->isNotPinned()) { bool MaybeUnpinned = false; @@ -1753,7 +1753,7 @@ bool GCChecker::evalCall(const CallEvent &Call, CheckerContext &C) const { State = State->set(Region, PinState::getTransitivePin(CurrentDepth)); } else { logWithDump("- Root and pin", Region); - State = State->set(Region, PinState::getPin(CurrentDepth)); + State = State->set(Region, PinState::getPin(CurrentDepth)); } // The Argument array may also be used as a value, so make it rooted // SymbolRef ArgArraySym = ArgArray.getAsSymbol(); @@ -1991,7 +1991,7 @@ void GCChecker::checkBind(SVal LVal, SVal RVal, const clang::Stmt *S, } report_value_error(C, Sym, "Saw assignment to root, but missed the allocation"); - } + } } else { logWithDump("- Found ValState for Sym", RValState); validateValue(RValState, C, Sym, "Trying to root value which may have been"); diff --git a/test/clangsa/MissingPinning.c b/test/clangsa/MissingPinning.c index 5a5a87d807a1f..2fa0a814a2b94 100644 --- a/test/clangsa/MissingPinning.c +++ b/test/clangsa/MissingPinning.c @@ -12,7 +12,7 @@ void unpinned_argument() { jl_svec_t *val = jl_svec1(NULL); // expected-note{{Started tracking value here}} JL_GC_PROMISE_ROOTED(val); // expected-note{{Value was rooted here}} look_at_value((jl_value_t*) val); // expected-warning{{Passing non-pinned value as argument to function that may GC}} - // expected-note@-1{{Passing non-pinned value as argument to function that may GC}} + // expected-note@-1{{Passing non-pinned value as argument to function that may GC}} } int allow_unpinned() {