Skip to content

Commit 93a9728

Browse files
committed
Change the assertion message to indicate that some cases are not implemented instread of should not happen
1 parent fdc265e commit 93a9728

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ void StdLibraryFunctionsChecker::NullnessConstraint::describe(
11691169
DescriptionKind DK, const CallEvent &Call, ProgramStateRef State,
11701170
const Summary &Summary, llvm::raw_ostream &Out) const {
11711171
assert(CannotBeNull &&
1172-
"Describe should not be used when the value must be NULL");
1172+
"'describe' is not implemented when the value must be NULL");
11731173
if (DK == Violation)
11741174
Out << "should not be NULL";
11751175
else
@@ -1179,7 +1179,8 @@ void StdLibraryFunctionsChecker::NullnessConstraint::describe(
11791179
bool StdLibraryFunctionsChecker::NullnessConstraint::describeArgumentValue(
11801180
const CallEvent &Call, ProgramStateRef State, const Summary &Summary,
11811181
llvm::raw_ostream &Out) const {
1182-
assert(!CannotBeNull && "This function is used when the value is NULL");
1182+
assert(!CannotBeNull && "'describeArgumentValue' is not implemented when the "
1183+
"value must be non-NULL");
11831184
Out << "is NULL";
11841185
return true;
11851186
}
@@ -1217,7 +1218,7 @@ void StdLibraryFunctionsChecker::BufferNullnessConstraint::describe(
12171218
DescriptionKind DK, const CallEvent &Call, ProgramStateRef State,
12181219
const Summary &Summary, llvm::raw_ostream &Out) const {
12191220
assert(CannotBeNull &&
1220-
"Describe should not be used when the value must be NULL");
1221+
"'describe' is not implemented when the buffer must be NULL");
12211222
if (DK == Violation)
12221223
Out << "should not be NULL";
12231224
else
@@ -1227,7 +1228,8 @@ void StdLibraryFunctionsChecker::BufferNullnessConstraint::describe(
12271228
bool StdLibraryFunctionsChecker::BufferNullnessConstraint::describeArgumentValue(
12281229
const CallEvent &Call, ProgramStateRef State, const Summary &Summary,
12291230
llvm::raw_ostream &Out) const {
1230-
assert(!CannotBeNull && "This function is used when the value is NULL");
1231+
assert(!CannotBeNull && "'describeArgumentValue' is not implemented when the "
1232+
"buffer must be non-NULL");
12311233
Out << "is NULL";
12321234
return true;
12331235
}

0 commit comments

Comments
 (0)