[all-commits] [llvm/llvm-project] a6302b: [-Wunsafe-buffer-usage] Check source location vali...
Ziqing Luo via All-commits
all-commits at lists.llvm.org
Wed Jul 19 15:05:05 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a6302b6934b349fff122eeb6c4b39eff580c4b1b
https://github.com/llvm/llvm-project/commit/a6302b6934b349fff122eeb6c4b39eff580c4b1b
Author: ziqingluo-90 <ziqing at udel.edu>
Date: 2023-07-19 (Wed, 19 Jul 2023)
Changed paths:
M clang/lib/Analysis/UnsafeBufferUsage.cpp
M clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-parm-unsupported.cpp
Log Message:
-----------
[-Wunsafe-buffer-usage] Check source location validity before using `TypeLoc`s
The safe-buffer analysis analyzes TypeLocs of types of variable
declarations in order to get source locations of them.
However, in some cases, the source locations of a TypeLoc are not
valid. Using invalid source locations results in assertion violation
or incorrect analysis or fix-its.
It is still not clear to me in what circumstances a TypeLoc does not
have valid source locations (it looks like a bug in Clang to me, but
it is not our responsibility to fix it). So we will conservatively
give up the analysis when required source locations are not valid.
Reviewed By: NoQ (Artem Dergachev)
Differential Revision: https://reviews.llvm.org/D155667
More information about the All-commits
mailing list