<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - raw_string_ostream doesn't set unbuffered"
   href="http://llvm.org/bugs/show_bug.cgi?id=19979">19979</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>raw_string_ostream doesn't set unbuffered
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Core LLVM classes
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>robeypointer@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>sorry if i got the component wrong. the bug is in Support/raw_ostream.h.

raw_string_ostream subclasses raw_ostream, but doesn't pass any value for the
"unbuffered" constructor field. the default is false (or buffered). but no
buffer is ever allocated because raw_string_ostream is a wrapper for a
std::string.

attempting to work around this bug will always end up in a codepath that tries
to delete[] the null buffer, and then sad faces all around.

the fix is simple. around line 441, this:

  explicit raw_string_ostream(std::string &O) : OS(O) {}

should be this:

  explicit raw_string_ostream(std::string &O) : raw_ostream(true), OS(O) {}</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>