[clang] [-Wcompletion-handler] Fix a non-termination issue (PR #78380)

Valeriy Savchenko via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 02:25:05 PST 2024


SavchenkoValeriy wrote:

Hey @ziqingluo-90, thank you for such a detailed description of the problem. It helped me to get up to speed quickly. 🙏 
However, I must say that I find this change too intrusive a this point, while not being 100% convinced that it is necessary.

Considering these rules (even be it for joining multiple paths), we shouldn't override `Reported` with `Escaped`. At the same time, we do that within a single block thanks to this code:
https://github.com/llvm/llvm-project/blob/5fcf907b34355980f77d7665a175b05fea7a6b7b/clang/lib/Analysis/CalledOnceCheck.cpp#L935
We do consider `Reported` to be an error state, and overwrite it. Maybe changing this logic and excluding `Reported` from that condition (i.e. `x.isErrorStatus() && x != Reported`) is the way to go? The reason for that is that we already found a problem on that path and the fact that it escaped before it shouldn't affect our conclusion. Another reason is more formal, `Reported` is supposed to be a top element of the lattice and this logic defies it.

Thanks again!

https://github.com/llvm/llvm-project/pull/78380


More information about the cfe-commits mailing list