llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Duplicate "Assuming pointer value..." piece.

Open haoNoQ opened this issue 7 years ago • 1 comments

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.

haoNoQ avatar Aug 09 '19 01:08 haoNoQ

assigned to @haoNoQ

haoNoQ avatar Aug 09 '19 01:08 haoNoQ