[all-commits] [llvm/llvm-project] 57adc3: [analyzer] Nullability: Don't infer nullable when ...

NoQ via All-commits all-commits at lists.llvm.org
Fri Nov 8 18:27:20 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 57adc37fe57c6edabc006e6de41523319e874c65
      https://github.com/llvm/llvm-project/commit/57adc37fe57c6edabc006e6de41523319e874c65
  Author: Artem Dergachev <artem.dergachev at gmail.com>
  Date:   2019-11-08 (Fri, 08 Nov 2019)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
    A clang/test/Analysis/nullability.m

  Log Message:
  -----------
  [analyzer] Nullability: Don't infer nullable when passing as nullable parameter.

You can't really infer anything from that.


  Commit: e4da37e8a0a3197baca674d683cb05341c6a4097
      https://github.com/llvm/llvm-project/commit/e4da37e8a0a3197baca674d683cb05341c6a4097
  Author: Artem Dergachev <artem.dergachev at gmail.com>
  Date:   2019-11-08 (Fri, 08 Nov 2019)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
    M clang/test/Analysis/NSContainers.m

  Log Message:
  -----------
  [analyzer] Fix skipping the call during inlined defensive check suppression.

When bugreporter::trackExpressionValue() is invoked on a DeclRefExpr,
it tries to do most of its computations over the node in which
this DeclRefExpr is computed, rather than on the error node (or whatever node
is stuffed into it). One reason why we can't simply use the error node is
that the binding to that variable might have already disappeared from the state
by the time the bug is found.

In case of the inlined defensive checks visitor, the DeclRefExpr node
is in fact sometimes too *early*: the call in which the inlined defensive check
has happened might have not been entered yet.

Change the visitor to be fine with tracking dead symbols (which it is totally
capable of - the collapse point for the symbol is still well-defined), and fire
it up directly on the error node. Keep using "LVState" to find out which value
should we be tracking, so that there weren't any problems with accidentally
loading an ill-formed value from a dead variable.

Differential Revision: https://reviews.llvm.org/D67932


Compare: https://github.com/llvm/llvm-project/compare/60ab30ebce83...e4da37e8a0a3


More information about the All-commits mailing list