[llvm-bugs] [Bug 42938] New: Duplicate "Assuming pointer value..." piece.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 8 18:31:13 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42938

            Bug ID: 42938
           Summary: Duplicate "Assuming pointer value..." piece.
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: dcoughlin at apple.com
          Reporter: noqnoqneo at gmail.com
                CC: dcoughlin at apple.com, llvm-bugs at lists.llvm.org

$ 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190809/d587b6dd/attachment.html>


More information about the llvm-bugs mailing list