[PATCH] D50488: [Analyzer] Checker for non-determinism caused by sorting of pointer-like keys

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 10 11:03:52 PDT 2018


NoQ added a comment.

> I'm only a beginner, but here are some things that caught my eye. I really like the idea! :)

Thanks, i appreciate help with reviews greatly.



================
Comment at: lib/StaticAnalyzer/Checkers/PointerSortingChecker.cpp:93
+  const RecordDecl *RD =
+    IterTy->getUnqualifiedDesugaredType()->getAsCXXRecordDecl();
+
----------------
Szelethus wrote:
> Is there a reason for not directly acquiring the record declaration?
I suspect it's about typedefs. We usually use `getCanonicalType()` for this purpose.


================
Comment at: test/Analysis/ptr-sort.cpp:1
+// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.nondeterminism.PointerSorting %s -analyzer-output=text -verify
+
----------------
Szelethus wrote:
> Always run the core checkers too.
> `-analyzer-checker=core,alpha.nondeterminism.PointerSorting`
This is a good discipline, but it's not very useful in case of AST-based checkers because they don't interact at all with each other.


Repository:
  rC Clang

https://reviews.llvm.org/D50488





More information about the cfe-commits mailing list