[LLVMbugs] [Bug 2953] New: raw_ostream operator<< resize logic buggy

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Oct 26 02:35:58 PDT 2008


           Summary: raw_ostream operator<< resize logic buggy
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu

Using SVN r58183 I got this error:

a.out: raw_ostream.cpp:182: llvm::raw_ostream&
llvm::raw_ostream::operator<<(const llvm::format_object_base&): Assertion
`BytesUsed > NextBufferSize && "Didn't grow buffer!?"' failed.

Looking at the code that assertion will always trigger if that execution path
is reached.

at line raw_ostream.cpp:163
NextBufferSize = BytesUsed;

at line raw_ostream.cpp:178
   if (BytesUsed < NextBufferSize)
      return write(&V[0], BytesUsed);

   // Otherwise, try again with a new size.
   assert(BytesUsed > NextBufferSize && "Didn't grow buffer!?");
   NextBufferSize = BytesUsed;

In this case BytesUsed == NextBufferSize, write is not called, and the
assertion fails.

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