[PATCH] D32437: [analyzer] Nullability: fix a crash when adding notes inside a synthesized property accessor.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 30 02:18:31 PDT 2017


NoQ added inline comments.


================
Comment at: lib/StaticAnalyzer/Core/PathDiagnostic.cpp:704
+    const LocationContext *ParentLC = LC->getParent();
+    while (ParentLC->getAnalysisDeclContext()->isBodyAutosynthesized()) {
+      LC = ParentLC;
----------------
zaks.anna wrote:
> Is ParentLC guaranteed never to be null? I would prefer checking for it inside the while. Even if it is not likely to happen now, the code could evolve to handle more cases..
We're unlikely to begin analysis at top-frames with auto-synthesized code bodies in the future. Added an assertion.


https://reviews.llvm.org/D32437





More information about the cfe-commits mailing list