-
Notifications
You must be signed in to change notification settings - Fork 5
Fix for malloc
incorrectly preventing checked region addition (issue #486)
#527
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
base: main
Are you sure you want to change the base?
Changes from 9 commits
ab08132
5bc128c
0c98fa8
461d506
72e1772
2f1d4c2
8a9a36b
bd92d70
66202c3
629b493
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,6 +215,10 @@ bool CheckedRegionFinder::VisitCStyleCastExpr(CStyleCastExpr *E) { | |
return true; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
bool CheckedRegionFinder::VisitCallExpr(CallExpr *C) { | ||
auto *FD = C->getDirectCallee(); | ||
FoldingSetNodeID ID; | ||
|
@@ -227,9 +231,10 @@ bool CheckedRegionFinder::VisitCallExpr(CallExpr *C) { | |
if (Info.hasTypeParamBindings(C,Context)) | ||
for (auto Entry : Info.getTypeParamBindings(C, Context)) | ||
Wild |= (Entry.second == nullptr); | ||
auto Type = FD->getReturnType(); | ||
const auto IT = FD->getInteropType(); | ||
const auto Type = FD->getReturnType(); | ||
Wild |= (!(FD->hasPrototype() || FD->doesThisDeclarationHaveABody())) || | ||
containsUncheckedPtr(Type); | ||
containsUncheckedPtr(IT.getTypePtrOrNull() ? IT : Type); | ||
auto *FV = Info.getFuncConstraint(FD, Context); | ||
for (unsigned I = 0; I < FV->numParams(); I++) | ||
Wild |= isWild(*FV->getExternalParam(I)); | ||
|
@@ -340,10 +345,11 @@ bool CheckedRegionFinder::isInStatementPosition(CallExpr *C) { | |
} | ||
|
||
bool CheckedRegionFinder::isWild(CVarOption Cv) { | ||
if (Cv.hasValue() && | ||
Cv.getValue().hasWild(Info.getConstraints().getVariables())) | ||
return true; | ||
return false; | ||
const auto &E = Info.getConstraints().getVariables(); | ||
if (Cv.hasValue()) | ||
return Cv.getValue().hasWild(E) || Cv.getValue().hasParamWild(E); | ||
else | ||
return false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering where the presence of type instantiations (i.e., that you return There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 227 in the handling of call expressions |
||
} | ||
|
||
bool CheckedRegionFinder::containsUncheckedPtr(QualType Qt) { | ||
|
Uh oh!
There was an error while loading. Please reload this page.