[libc-commits] [PATCH] D129808: [libc] add unsafe mode to strlen

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Nov 28 15:33:46 PST 2022


sivachandra added a comment.

In D129808#3954947 <https://reviews.llvm.org/D129808#3954947>, @nickdesaulniers wrote:

> In D129808#3660990 <https://reviews.llvm.org/D129808#3660990>, @michaelrj wrote:
>
>> change from using FLAGS to using a full cmake option. Currently it defaults to off, so if we want to test this on the bots then we'll either need to change the default or adjust the cmake command the bots use.
>
> IIRC, @michaelrj and I had a discussion about how this relates to sanitizers.  For `LIBC_FAST_UNSAFE_STRLEN` could this be the default unless an existing cmake flag is used to build llvm-libc sanitized? (I assume there's an existing cmake flag for denoting that I would like a build of llvm-libc instrumented with *SAN?)

Reading a word vs reading a byte can employed at places beyond `strlen` I think. So, we should probably name the flag more generic like, `LIBC_FAST_UNSAFE_WORD_READ`. Also, we will want the default behavior to be the opposite. As in, it should be `OFF` by default and should be switched `ON` explicitly. There is an LLVM CMake flag for sanitizers - `-DLLVM_USE_SANITIZER=<...>`. I would think this flag and the unsafe word reading flag should not be mixed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129808



More information about the libc-commits mailing list