<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - False positive dereference null-dereference on destructor with 'noreturn'"
   href="http://llvm.org/bugs/show_bug.cgi?id=15599">15599</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>False positive dereference null-dereference on destructor with 'noreturn'
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.2
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>kremenek@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>andrewjcg@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>