[llvm-bugs] [Bug 32137] New: tools/bugpoint/ToolRunner.cpp:386: bad for loop ?

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Mar 4 02:47:43 PST 2017


http://bugs.llvm.org/show_bug.cgi?id=32137

            Bug ID: 32137
           Summary: tools/bugpoint/ToolRunner.cpp:386: bad for loop ?
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dcb314 at hotmail.com
                CC: llvm-bugs at lists.llvm.org

tools/bugpoint/ToolRunner.cpp:386]: (error) When Pos==CommandLine.size(),
CommandLine[Pos] is out of bounds.

Source code is

  for (std::size_t Pos = 0u; Pos <= CommandLine.size(); ++Pos) {
    if ('\\' == CommandLine[Pos]) {

Maybe better code

  for (std::size_t Pos = 0u; Pos < CommandLine.size(); ++Pos) {
    if ('\\' == CommandLine[Pos]) {

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170304/b3f9f7f7/attachment.html>


More information about the llvm-bugs mailing list