[LLVMbugs] [Bug 14670] New: readsome() need to reset gcount to zero.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Dec 20 06:15:46 PST 2012


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

             Bug #: 14670
           Summary: readsome() need to reset gcount to zero.
           Product: libc++
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
        AssignedTo: hhinnant at apple.com
        ReportedBy: tuhertz at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


readsome() in basic_istream should reset __gc_ to zero as read() does.
Currently, readsome() return old value if in_avail() is 0 or -1.

template<class _CharT, class _Traits>
streamsize
basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
{
+   __gc_ = 0;
    streamsize __c = this->rdbuf()->in_avail();
    switch (__c)
    {
    case -1:
        this->setstate(ios_base::eofbit);
        break;
    case 0:
        break;
    default:
        read(__s, _VSTD::min(__c, __n));
        break;
    }
    return __gc_;
}

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