Issue 122937
Summary llvm/lib/CodeGen/LiveRangeUtils.h:40: Iterators applied to wrong data structure ?
Labels llvm:codegen, code-quality
Assignees
Reporter dcb314
    Static analyser cppcheck says:

llvm/lib/CodeGen/LiveRangeUtils.h:40:6: error: Same iterator is used with different containers 'LR' and 'LR.segments'. [iterators1]

Source code is

  typename LiveRangeT::iterator J = LR.begin(), E = LR.end();
  // ...
  LR.segments.erase(J, E);

So J and E are iterators for LR, but get used on LR.segments.

I am surprised this compiles.


_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to