<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 - Reading block address array from LLVM assembly file changes the target block"
   href="https://bugs.llvm.org/show_bug.cgi?id=46183">46183</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Reading block address array from LLVM assembly file changes the target block
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>timothy.werquin@guardsquare.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23569" name="attach_23569" title="The LLVM assembly file that reproduces the issue">attachment 23569</a> <a href="attachment.cgi?id=23569&action=edit" title="The LLVM assembly file that reproduces the issue">[details]</a></span>
The LLVM assembly file that reproduces the issue

I have an LLVM assembly file which will be read incorrectly by LLVM.
The array of block addresses `bbAdresses` contains several targets in the main
function. But when read by llvm-as and then disassembled by llvm-dis, all
elements of the array will point to the unnamed basic block.

So just doing `llvm-as -o - broken.ll | llvm-dis -o -` will output the
incorrect array.
When compiling the file using `clang` it will produce an infinite loop as the
targets of all indirect branches have been changed to the same basic block.

I tested using both the brew clang-8 toolchain and the default Apple clang
version 11.0.0</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>