[PATCH] D125040: [Support] Fix UB in BumpPtrAllocator when first allocation is zero.

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 13:59:24 PDT 2022


sammccall added a comment.

Here's an example of an innocuous-looking Allocate() that can be zero-sized: https://github.com/llvm/llvm-project/blob/16dcbb53dc7968a3752661aac731172ebe0faf64/clang-tools-extra/pseudo/lib/Forest.cpp#L130

Found this by running a fuzzer on clang-pseudo, in an environment that instruments `returns_nonnull` functions (probably it's UBSan)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125040/new/

https://reviews.llvm.org/D125040



More information about the llvm-commits mailing list