mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 00:36:36 +00:00
Don't add null characters to the end of the APFloat string buffer.
Report/patch inspiration by Olaf Krzikalla. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160744 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e3094283e3
commit
9f14ed1c60
@ -3278,16 +3278,8 @@ APFloat::APFloat(double d) : exponent2(0), sign2(0) {
|
||||
}
|
||||
|
||||
namespace {
|
||||
static void append(SmallVectorImpl<char> &Buffer,
|
||||
unsigned N, const char *Str) {
|
||||
unsigned Start = Buffer.size();
|
||||
Buffer.set_size(Start + N);
|
||||
memcpy(&Buffer[Start], Str, N);
|
||||
}
|
||||
|
||||
template <unsigned N>
|
||||
void append(SmallVectorImpl<char> &Buffer, const char (&Str)[N]) {
|
||||
append(Buffer, N, Str);
|
||||
void append(SmallVectorImpl<char> &Buffer, StringRef Str) {
|
||||
Buffer.append(Str.begin(), Str.end());
|
||||
}
|
||||
|
||||
/// Removes data from the given significand until it is no more
|
||||
|
Loading…
Reference in New Issue
Block a user