llvm-project
llvm-project copied to clipboard
Duplicate "Assuming pointer value..." piece.
| Bugzilla Link | 42938 |
| Version | 9.0 |
| OS | All |
| CC | @devincoughlin |
Extended Description
$ cat test.c
static int *conjure();
void use(int);
void foo() { int *p = conjure(); p && 0; use(*p); }
void bar() { foo(); }
$ clang --analyze test.c --analyzer-output text
... repro.c:7:3: note: Assuming 'p' is null p && 0; ^ repro.c:7:3: note: Assuming pointer value is null p && 0; ^ repro.c:7:5: note: Left side of '&&' is false p && 0; ^ ...
The second note, "Assuming pointer value is null", is clearly redundant. Interestingly, bar() is necessary to reproduce the problem.
assigned to @haoNoQ