diff options
author | Malavika Samak <malavika.samak@gmail.com> | 2025-05-16 18:33:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-16 18:33:51 -0700 |
commit | 39315663a40a261772df94218fd33e205e888e54 (patch) | |
tree | 7bd3e66ecfe68f29ad985701a16729b5f3bd5520 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | f7ef8dcbad9d5ac6cf2a8917d5ce03564fdfd0d8 (diff) | |
download | llvm-39315663a40a261772df94218fd33e205e888e54.zip llvm-39315663a40a261772df94218fd33e205e888e54.tar.gz llvm-39315663a40a261772df94218fd33e205e888e54.tar.bz2 |
[-Wunsafe-buffer-usage] Fix false warnings when const sized array is safely accessed (array [idx %const]) (#140113)
The -Wunsafe-buffer-usage analysis currently warns when a const sized
array is safely accessed, with an index that is bound by the remainder
operator. The false alarm is now suppressed.
Example:
int circular_buffer(int array[10], uint idx) {
return array[idx %10]; // Safe operation
}
rdar://148443453
---------
Co-authored-by: MalavikaSamak <malavika2@apple.com>
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions