[LLVMbugs] [Bug 11992] New: crash AliasSetTracker.h

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 13 00:04:20 PST 2012


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

             Bug #: 11992
           Summary: crash AliasSetTracker.h
           Product: tools
           Version: 2.8
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: llvm-ld
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: garrofi at hotmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


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();
      }
  }

this code is failing if the last element in the stl vector gets deleted

and with this it's fixed
  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();
      }
  }

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