Page MenuHomePhabricator

Fix UBSan bot by not passing NULL into memcpy src.
ClosedPublic

Authored by krasin on Aug 30 2016, 11:52 AM.

Details

Summary

UBSan complains like the following:
tools/lld/COFF/Writer.cpp:97:15: runtime error: null pointer passed as argument 2, which is declared to never be null

The reason is that the vector could be empty.

Diff Detail

Repository
rL LLVM

Event Timeline

krasin updated this revision to Diff 69738.Aug 30 2016, 11:52 AM
krasin retitled this revision from to Fix UBSan bot by not passing NULL into memcpy src..
krasin updated this object.
krasin added a reviewer: rsmith.
krasin added a subscriber: kcc.
Eugene.Zelenko added inline comments.
COFF/Writer.cpp
96 ↗(On Diff #69738)

Please use !Config->PDBPath.empty(). See relevant Clang-tidy check.

krasin updated this revision to Diff 69773.Aug 30 2016, 4:03 PM

Fix a style guide violation.

krasin marked an inline comment as done.Aug 30 2016, 4:03 PM

Thank you, Eugene. Done.

This revision was automatically updated to reflect the committed changes.

I have submitted the CL, as it's aimed to fix a bot. Feel free to send post-submit comments, and I will create a follow-up CL, if needed.