Commit Graph

1 Commits

Author SHA1 Message Date
Michael Jones a3b745818d [libc] add unsafe mode to strlen
The only safe way to implement strlen involves reading the string one
char at a time. It is faster to read in larger blocks, but this leads to
reading beyond the string boundary, which is undefined behavior. This
patch adds an implementation and flag to use this fast but unsafe
version of strlen.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D129808
2022-11-30 16:48:35 -08:00