[LLVMbugs] [Bug 5291] New: JITEmitter holds iterator across set insert()

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Oct 23 17:00:12 PDT 2009


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

           Summary: JITEmitter holds iterator across set insert()
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: ASSIGNED
          Severity: normal
          Priority: P2
         Component: Target-Independent JIT
        AssignedTo: dalej at apple.com
        ReportedBy: jyasskin at google.com
                CC: evan.cheng at apple.com, llvmbugs at cs.uiuc.edu


JITEmitter::GetSizeOfGlobalsInBytes() iterates over GVSet and holds the
iterator across calls to GVSet.insert() (in addSizeOfGlobalsInConstantVal).
r54442 introduced this code with GVSet as a std::set. It was incorrect then
because a new GlobalVariable* could wind up behind the current iterator,
causing it to return a too-small size.

r58835 compounded the problem by changing GVSet to a SmallPtrSet, whose
iterators are invalidated on an insert().

Please add a test that fails before the fix too.


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