Fix Undefined Behavior in MLIR Diagnostic: don't call memcpy with a nullptr source
authorMehdi Amini <joker.eph@gmail.com>
Sat, 2 Oct 2021 21:28:28 +0000 (21:28 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Sat, 2 Oct 2021 21:32:20 +0000 (21:32 +0000)
commit9312cb6f2092f73fdc4b288cbbd29129fc83c386
tree2493f79bf1d72015302b531be3a480cc720e1d7e
parent57d9adefa04dc65096b8ba3e5763c15305676f73
Fix Undefined Behavior in MLIR Diagnostic: don't call memcpy with a nullptr source

This happens when streaming an empty Twine as part of a diagnostic.

Differential Revision: https://reviews.llvm.org/D111002
mlir/lib/IR/Diagnostics.cpp