[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-09-06 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert added a comment. In D152246#4639495 , @tbaeder wrote: > Do you think warning on assignment of function pointers with mismatched > attributes would be a viable way forward? Yes, that sounds like the right approach. (Slightly relaxed perhaps,

[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-09-06 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. @aaronpuchert Do you think warning on assignment of function pointers with mismatched attributes is would be a viable way forward? This is what https://github.com/elmarco/clang/commit/bac94282a5c8e3b0410ee8c0522fbdb872ade00c tries to implement IIUC. CHANGES SINCE LAST

[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-08-20 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert added a comment. In D152246#4484366 , @tbaeder wrote: > So, the problem with this (type of) analysis is that we don't have a perfect > view of the (global) program state, right? The CFG is per-function, and any > other function (etc.) might

[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-07-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152246/new/ https://reviews.llvm.org/D152246 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-07-17 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152246/new/ https://reviews.llvm.org/D152246 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-07-10 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. > Maybe you can show an example how this might look like in practice? AFAIU, the real-world case is more a C "class" struct with a couple of function pointers (a vtable), which might be different depending on circumstances. So, the problem with this (type of) analysis i

[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-06-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D152246#4412333 , @aaronpuchert wrote: > That's a tough one. The change seems to be correct, and makes more patterns > visible. Of course I wonder how it comes that we see calls of a function > pointer with a uniquely

[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-06-11 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert added a comment. That's a tough one. The change seems to be correct, and makes more patterns visible. Of course I wonder how it comes that we see calls of a function pointer with a uniquely determined value, as that would seem like obfuscation. Maybe you can show an example how thi

[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-06-10 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 530177. tbaeder marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152246/new/ https://reviews.llvm.org/D152246 Files: clang/lib/Analysis/ThreadSafety.cpp Index: clang/lib/Analysis/ThreadSafety.cpp ===

[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-06-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. > I think ideally we would get all possible values at this point and analyze > them all(?), but I'm not sure how to implement this. Err, if we don't know the callee, there's not a whole lot we can do. I don't think we'd want to make guesses at what potentially cou

[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-06-06 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: delesley, aaronpuchert, Eugene.Zelenko, aaron.ballman. Herald added a reviewer: NoQ. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When we're cal