Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trailing whitespaces introduced in #51 #53

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/clangsa/GCChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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";
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1753,7 +1753,7 @@ bool GCChecker::evalCall(const CallEvent &Call, CheckerContext &C) const {
State = State->set<GCPinMap>(Region, PinState::getTransitivePin(CurrentDepth));
} else {
logWithDump("- Root and pin", Region);
State = State->set<GCPinMap>(Region, PinState::getPin(CurrentDepth));
State = State->set<GCPinMap>(Region, PinState::getPin(CurrentDepth));
}
// The Argument array may also be used as a value, so make it rooted
// SymbolRef ArgArraySym = ArgArray.getAsSymbol();
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion test/clangsa/MissingPinning.c
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading