This is an archive of the discontinued LLVM Phabricator instance.

[Support] - Check nullptr after allocation with malloc in MallocAllocator
AcceptedPublic

Authored by kkretzsch on Jan 18 2018, 6:44 AM.

Details

Reviewers
hans
MatzeB
Summary

As a follow up of our nullptr check patches,

https://reviews.llvm.org/D34753
https://reviews.llvm.org/D35414

this patch introduces a nullptr checks on the llvm MallocAllocator class itself.

Diff Detail

Event Timeline

kkretzsch created this revision.Jan 18 2018, 6:44 AM
MatzeB accepted this revision.Jan 18 2018, 9:38 AM

LGTM.

include/llvm/Support/Allocator.h
99–101

Don't use braces around 1-line ifs.

This revision is now accepted and ready to land.Jan 18 2018, 9:38 AM
kkretzsch marked an inline comment as done.Jan 19 2018, 8:09 AM