[LLVMbugs] [Bug 9639] New: Crash during llvm-ld

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 7 03:14:39 PDT 2011


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

           Summary: Crash during llvm-ld
           Product: new-bugs
           Version: 2.8
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: garrofi at hotmail.com
                CC: llvmbugs at cs.uiuc.edu


AliasSetTracker.h

  void removeCallSite(CallSite CS) {
    for (size_t i = 0, e = CallSites.size(); i != e; ++i)
      if (CallSites[i] == CS.getInstruction()) {
        CallSites[i] = CallSites.back();
        CallSites.pop_back();
      }
  }


this code is wrong, it caches the size of the vector but it doesn't update the
size after removing an element from the vector

this piece of code fixes it

 void removeCallSite(CallSite CS) {
    for (size_t i = 0; i != CallSites.size(); ++i)
      if (CallSites[i] == CS.getInstruction()) {
        CallSites[i] = CallSites.back();
        CallSites.pop_back();
      }
  }

Thanks,
Miguel

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list