[-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
Loading
Please sign in to comment