https://bugs.llvm.org/show_bug.cgi?id=47073

            Bug ID: 47073
           Summary: 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/CodeGenDAGPa
                    tterns.cpp:line 59 and line 771)
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Object
          Assignee: unassignedb...@nondot.org
          Reporter: i...@ustchcs.com
                CC: llvm-bugs@lists.llvm.org

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.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to