Replace GetNumBytesInBuffer() in MicrosoftCXXNameMangler::mangleArgumentType by tell().
Using GetNumBytesInBuffer() assumes that the stream was not flushed between the GetNumBytesInBuffer() calls, which may happen to be true or not, depending on stream policy. tell() always reports the correct stream location. Do note there are only two more uses of GetNumBytesInBuffer() in LLVM+clang, in lib/MC/MCAsmStreamer.cpp and lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp. The former may be replacable by tell (needs testing) but while the later can not be immediatly replaced by tell() as it uses the absolute value of GetNumBytesInBuffer() rather than the real stream position. Both uses seems to depend upon flush policy and thus may not work correctly depending upon the stream behaviour. Going forward, GetNumBytesInBuffer() should probably be protected, non-accessible to raw_ostream clients. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236389 91177308-0d34-0410-b5e6-96231b3b80d8
Loading
Please register or sign in to comment