[Lldb-commits] [PATCH] D39578: Fix a couple of self-assignments using memcpy.

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 13 10:11:24 PST 2017


clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

First change looks good. Second one we can probably avoid doing anything in Value::AppendDataToHostBuffer and return 0. No need to copy data over itself.



================
Comment at: source/Core/Value.cpp:146-147
 size_t Value::AppendDataToHostBuffer(const Value &rhs) {
+  // FIXME: What should we do if this == &rhs?
+  // If we allow, change s/memcpy/memmove/ below.
   size_t curr_size = m_data_buffer.GetByteSize();
----------------
Should probably return 0 if this == &rhs?


https://reviews.llvm.org/D39578





More information about the lldb-commits mailing list