[all-commits] [llvm/llvm-project] 53aed4: [libcxx] Fix crash in std::stringstream with paylo...

Azat Khuzhin via All-commits all-commits at lists.llvm.org
Wed May 17 09:21:24 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 53aed4759b33e33614e0f4e321bc1ef764b6d5b6
      https://github.com/llvm/llvm-project/commit/53aed4759b33e33614e0f4e321bc1ef764b6d5b6
  Author: Azat Khuzhin <a3at.mail at gmail.com>
  Date:   2023-05-17 (Wed, 17 May 2023)

  Changed paths:
    M libcxx/include/sstream
    A libcxx/test/std/input.output/string.streams/stringstream.members/gcount.pass.cpp

  Log Message:
  -----------
  [libcxx] Fix crash in std::stringstream with payload >= INT_MAX

stringstream does works for payload > INT_MAX, however
stringstream::gcount() can break the internal field (__nout_) and this
breaks the stringstream itself, and so the program will crash.

Fix this, by using __pbump(streamsize) over pbump(int)

Note, libstdc++ does not have this bug.

Reviewed By: #libc, ldionne, Mordante

Spies: arichardson, Mordante, philnik, ldionne, libcxx-commits, mikhail.ramalho

Differential Revision: https://reviews.llvm.org/D146294




More information about the All-commits mailing list