<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 - In the for-range statement, erase() should not be used to remove the elements which the loop iterates over.(Potential defects)(llvm-project/llvm/utils/TableGen/CodeGenDAGPatterns.cpp:line 59 and line 771)"
   href="https://bugs.llvm.org/show_bug.cgi?id=47073">47073</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>In the for-range statement, erase() should not be used to remove the elements which the loop iterates over.(Potential defects)(llvm-project/llvm/utils/TableGen/CodeGenDAGPatterns.cpp:line 59 and line 771)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>All
          </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>Object
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>info@ustchcs.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In the for-range statement, erase() should not be used to remove the elements
which the loop iterates over.(Potential defects)

commit e3546c78cabfbf670391a57766872f0a8e28a423

llvm-project/llvm/utils/TableGen/CodeGenDAGPatterns.cpp:line 59 

    55    for (MVT T : S) {
    56      if (!P(T))
    57        continue;
    58      Erased = true;
    59      S.erase(T);
    60    }
    61    return Erased;
    62  }

llvm-project/llvm/utils/TableGen/CodeGenDAGPatterns.cpp:line 771

   764    std::set<MVT> Ovs;
   765    for (MVT T : Out) {
   766      if (!T.isOverloaded())
   767        continue;
   768  
   769      Ovs.insert(T);
   770      // MachineValueTypeSet allows iteration and erasing.
   771      Out.erase(T);
   772    }

Reported by: Ustchcs Toolsets Bugfinder
(bugfinder-13.15: In the for-range statement, erase() should not be used to
remove the elements which the loop iterates over.)</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>