<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 about Use of memory after it is freed for OpenJDK"
   href="https://bugs.llvm.org/show_bug.cgi?id=40913">40913</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>False positive about Use of memory after it is freed for OpenJDK
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>dcoughlin@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>zhaixiang@loongson.cn
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dcoughlin@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi,

Bug reported by the clang static analyzer.

Description: Use of memory after it is freed
File: 
/home/loongson/zhaixiang/jdk12-mips-llvm/src/java.base/share/native/libverify/check_code.c[1]
Line: 1328

Preprocessed file[2] is available.

I argue that Use of memory after it is freed is *False Positive*

----- 8< -------- 8< -------- 8< -------- 8< -------- 8< -------- 8< ---
src/java.base/share/native/libverify/check_code.c:1328:22: warning: Use 
of memory after it is freed
         clazz_info = cp_index_to_class_fullinfo(context, key,
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

----- 8< -------- 8< -------- 8< -------- 8< -------- 8< -------- 8< ---

Full analyzer log and invocation[3] is available too.  Please change 
include file path, for example, 
/home/loongson/zhaixiang/jdk12-mips-llvm/src/java.base/share/native/libjava 
change to YOUR_OPENJDK_SRC_DIR/src/java.base/share/native/libjava

Perhaps it doesn't need to include the *build* directories, otherwise it 
is difficult to reproduce the issue :)

Cheers,

Leslie Zhai

[1]
<a href="http://hg.openjdk.java.net/jdk/jdk12/file/0276cba45aac/src/java.base/share/native/libverify/check_code.c#l1328">http://hg.openjdk.java.net/jdk/jdk12/file/0276cba45aac/src/java.base/share/native/libverify/check_code.c#l1328</a>

[2] <a href="https://raw.githubusercontent.com/xiangzhai/jdk-dev/master/check_code.c">https://raw.githubusercontent.com/xiangzhai/jdk-dev/master/check_code.c</a>

[3]
<a href="https://raw.githubusercontent.com/xiangzhai/jdk-dev/master/check_code_analyzer.log">https://raw.githubusercontent.com/xiangzhai/jdk-dev/master/check_code_analyzer.log</a></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>