basic: make check-pointer-deref clean

Add the needed assert changes to make the code clean
for the new check-pointer-deref script.

Note that for `_cmp()` functions its a bit of a question
if we want `assert()` or `POINTER_MAY_BE_NULL()` here. The
former is more correct but it adds a (small) runtime hit. If
we use POINTER_MAY_BE_NULL() it is compiled out but strictly
speaking it is wrong (so at least we would need a comment).
This commit is contained in:
Michael Vogt
2026-03-31 18:30:40 +02:00
parent 1692d51eb2
commit 18e70eec2f
30 changed files with 146 additions and 3 deletions
+5
View File
@@ -1151,6 +1151,8 @@ int safe_personality(unsigned long p) {
int opinionated_personality(unsigned long *ret) {
int current;
assert(ret);
/* Returns the current personality, or PERSONALITY_INVALID if we can't determine it. This function is a bit
* opinionated though, and ignores all the finer-grained bits and exotic personalities, only distinguishing the
* two most relevant personalities: PER_LINUX and PER_LINUX32. */
@@ -1191,6 +1193,9 @@ void valgrind_summary_hack(void) {
int pid_compare_func(const pid_t *a, const pid_t *b) {
/* Suitable for usage in qsort() */
assert(a);
assert(b);
return CMP(*a, *b);
}