[libc-commits] [PATCH] D147813: [libc] clean up ctype negative handling

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Apr 7 14:05:25 PDT 2023


michaelrj created this revision.
michaelrj added reviewers: sivachandra, lntue.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
michaelrj requested review of this revision.

The ctype functions will sometimes be passed negative numbers, such as
EOF. Some of the previous implementations didn't handle these properly.
Additionally, the tests did not check any negative numbers. These
problems have been fixed.

This patch fixes https://github.com/llvm/llvm-project/issues/62000


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147813

Files:
  libc/src/ctype/isblank.cpp
  libc/src/ctype/iscntrl.cpp
  libc/test/src/ctype/CMakeLists.txt
  libc/test/src/ctype/isalnum_test.cpp
  libc/test/src/ctype/isalpha_test.cpp
  libc/test/src/ctype/isascii_test.cpp
  libc/test/src/ctype/isblank_test.cpp
  libc/test/src/ctype/iscntrl_test.cpp
  libc/test/src/ctype/isdigit_test.cpp
  libc/test/src/ctype/isgraph_test.cpp
  libc/test/src/ctype/islower_test.cpp
  libc/test/src/ctype/isprint_test.cpp
  libc/test/src/ctype/ispunct_test.cpp
  libc/test/src/ctype/isspace_test.cpp
  libc/test/src/ctype/isupper_test.cpp
  libc/test/src/ctype/isxdigit_test.cpp
  libc/test/src/ctype/toascii_test.cpp
  libc/test/src/ctype/tolower_test.cpp
  libc/test/src/ctype/toupper_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147813.511793.patch
Type: text/x-patch
Size: 11964 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230407/a5c61615/attachment-0001.bin>


More information about the libc-commits mailing list