-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[clang][analyzer][NFC] Add a helper for conjuring symbols at call events #137182
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
Changes from all commits
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 |
---|---|---|
|
@@ -851,9 +851,8 @@ void SmartPtrModeling::handleBoolConversion(const CallEvent &Call, | |
if (InnerPointerType.isNull()) | ||
return; | ||
|
||
const LocationContext *LC = C.getLocationContext(); | ||
InnerPointerVal = C.getSValBuilder().conjureSymbolVal( | ||
CallExpr, LC, InnerPointerType, C.blockCount()); | ||
Call, InnerPointerType, C.blockCount()); | ||
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. For example, this inner pointer type is sometimes different from the call result type. |
||
State = State->set<TrackedRegionMap>(ThisRegion, InnerPointerVal); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -584,11 +584,9 @@ class StdLibraryFunctionsChecker | |
const Summary &Summary, | ||
CheckerContext &C) const override { | ||
SValBuilder &SVB = C.getSValBuilder(); | ||
NonLoc ErrnoSVal = | ||
SVB.conjureSymbolVal(&Tag, Call.getOriginExpr(), | ||
C.getLocationContext(), C.getASTContext().IntTy, | ||
C.blockCount()) | ||
.castAs<NonLoc>(); | ||
NonLoc ErrnoSVal = SVB.conjureSymbolVal(Call, C.getASTContext().IntTy, | ||
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. This int type is different from the call result type at times too. |
||
C.blockCount(), &Tag) | ||
.castAs<NonLoc>(); | ||
return errno_modeling::setErrnoForStdFailure(State, C, ErrnoSVal); | ||
} | ||
}; | ||
|
@@ -1481,8 +1479,7 @@ bool StdLibraryFunctionsChecker::evalCall(const CallEvent &Call, | |
ProgramStateRef State = C.getState(); | ||
const LocationContext *LC = C.getLocationContext(); | ||
const auto *CE = cast<CallExpr>(Call.getOriginExpr()); | ||
SVal V = C.getSValBuilder().conjureSymbolVal( | ||
CE, LC, CE->getType().getCanonicalType(), C.blockCount()); | ||
SVal V = C.getSValBuilder().conjureSymbolVal(Call, C.blockCount()); | ||
State = State->BindExpr(CE, LC, V); | ||
|
||
C.addTransition(State); | ||
|
Uh oh!
There was an error while loading. Please reload this page.