[LLVMbugs] [Bug 15599] New: False positive dereference null-dereference on destructor with 'noreturn'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Mar 26 11:55:57 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15599

            Bug ID: 15599
           Summary: False positive dereference null-dereference on
                    destructor with 'noreturn'
           Product: clang
           Version: 3.2
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: andrewjcg at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I appear to be getting a false positive null dereference warning when running
'clang --analyze' on the following code segment:

  #include <stdlib.h>

  class Test {
  public:
    Test() {}
    __attribute__((noreturn)) ~Test(){
      abort();
    }
  };

  __attribute__((noreturn)) void test () {
    abort();
  }

  void myfunc(int * t) {
    if (t == nullptr) {
      Test a();  // causes null dereference warning below on '*t = 4'
      //test();  // works
    }
    *t = 4;
  }

Since the destructor aborts, it appears (unless I'm missing something) that the
program could never actually dereference a null.

-- 
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/20130326/9ddde41e/attachment.html>


More information about the llvm-bugs mailing list