[PATCH] D26638: Don't pass nullptr into memcpy
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 14 14:19:58 PST 2016
Thanks!
On Mon, Nov 14, 2016 at 2:15 PM Vitaly Buka <vitalybuka at google.com> wrote:
> This revision was automatically updated to reflect the committed changes.
> Closed by commit rL286896: Don't pass nullptr into memcpy (authored by
> vitalybuka).
>
> Changed prior to commit:
> https://reviews.llvm.org/D26638?vs=77887&id=77888#toc
>
> Repository:
> rL LLVM
>
> https://reviews.llvm.org/D26638
>
> Files:
> llvm/trunk/include/llvm/DebugInfo/MSF/ByteStream.h
>
>
> Index: llvm/trunk/include/llvm/DebugInfo/MSF/ByteStream.h
> ===================================================================
> --- llvm/trunk/include/llvm/DebugInfo/MSF/ByteStream.h
> +++ llvm/trunk/include/llvm/DebugInfo/MSF/ByteStream.h
> @@ -91,6 +91,9 @@
> uint32_t getLength() const override { return
> ImmutableStream.getLength(); }
>
> Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> Buffer) const
> override {
> + if (Buffer.empty())
> + return Error::success();
> +
> if (Data.size() < Buffer.size())
> return make_error<MSFError>(msf_error_code::insufficient_buffer);
> if (Offset > Buffer.size() - Data.size())
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161114/7d85571a/attachment.html>
More information about the llvm-commits
mailing list