diff options
author | Ziqing Luo <ziqing@udel.edu> | 2023-04-12 14:40:14 -0700 |
---|---|---|
committer | Ziqing Luo <ziqing@udel.edu> | 2023-04-12 14:51:46 -0700 |
commit | 762af11d4c5d0bd1e76f23a07087773db09ef17d (patch) | |
tree | 54de2f5b06d04c28d12e46a53d80a75fa5f0eff3 /lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp | |
parent | 401e9e42916b0926465f35544b6cdadcbd8e36b4 (diff) | |
download | llvm-762af11d4c5d0bd1e76f23a07087773db09ef17d.zip llvm-762af11d4c5d0bd1e76f23a07087773db09ef17d.tar.gz llvm-762af11d4c5d0bd1e76f23a07087773db09ef17d.tar.bz2 |
[-Wunsafe-buffer-usage] Add a Fixable for pointer pre-increment
For a pointer type expression `e` of the form `++DRE`, if `e` is under
an Unspecified Pointer Context (UPC) and `DRE` is suppose to be
transformed to have std:span type, we generate fix-its that transform `e` to
`(DRE = DRE.subspan(1)).data()`.
For reference, `e` is in an UPC if `e` is
- an argument of a function call (except the callee has [[unsafe_buffer_usage]] attribute), or
- the operand of a cast-to-(Integer or Boolean) operation; or
- the operand of a pointer subtraction operation; or
- the operand of a pointer comparison operation;
We may extend the definition of UPC by adding more cases later.
Reviewed by: NoQ (Artem Dergachev)
Differential revision: https://reviews.llvm.org/D144304
Diffstat (limited to 'lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp')
0 files changed, 0 insertions, 0 deletions