File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ class DataBufferHeap : public DataBuffer {
80
80
// / to resize itself to.
81
81
// /
82
82
// / \return
83
- // / The size in bytes after that this heap buffer was
84
- // / successfully resized to .
83
+ // / The size in bytes after this heap buffer was resized. If
84
+ // / the resize failed the size will remain unchanged .
85
85
lldb::offset_t SetByteSize (lldb::offset_t byte_size);
86
86
87
87
// / Makes a copy of the \a src_len bytes in \a src.
Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ uint64_t DataBufferHeap::GetByteSize() const { return m_data.size(); }
47
47
// Sets the number of bytes that this object should be able to contain. This
48
48
// can be used prior to copying data into the buffer.
49
49
uint64_t DataBufferHeap::SetByteSize (uint64_t new_size) {
50
- m_data.resize (new_size);
50
+ if (new_size < m_data.max_size ())
51
+ m_data.resize (new_size);
51
52
return m_data.size ();
52
53
}
53
54
You can’t perform that action at this time.
0 commit comments