diff options
author | David Spickett <david.spickett@linaro.org> | 2025-07-08 08:52:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-08 08:52:36 +0100 |
commit | d889a7485f77c214ee57d0a74bf164237fdfa423 (patch) | |
tree | 7d357768824f6cb43a5cce3e0b2e054edec0b517 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 28375572f6679b659bb2e8a6535b4b2101b4410e (diff) | |
download | llvm-d889a7485f77c214ee57d0a74bf164237fdfa423.zip llvm-d889a7485f77c214ee57d0a74bf164237fdfa423.tar.gz llvm-d889a7485f77c214ee57d0a74bf164237fdfa423.tar.bz2 |
[flang] Avoid UB in CharBlock Compare to C string (#147329)
The behaviour of strncmp is undefined if either string pointer is null
(https://en.cppreference.com/w/cpp/string/byte/strncmp.html).
I've copied the logic over from Compare to another CharBlock, which had
code to avoid UB in memcmp.
The test Preprocessing/kind-suffix.F90 was failing with UBSAN enabled,
and now passes.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions