This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Correctly model iteration through "nil" objects
ClosedPublic

Authored by george.karpenkov on Mar 6 2018, 4:04 PM.

Details

Summary

Previously, iteration through nil objects which resulted from objc-messages being set to nil were modeled incorrectly.

There are a couple of notes about this patch:

  • In principle, ExprEngineObjC might be left untouched IFF osx.loops checker is enabled. I however think that we should not do something completely incorrect depending on what checkers are left on.
  • We should evaluate and potentially remove altogether the isConsumedExpr performance heuristic, as it seems very fragile.

rdar://22205149

Diff Detail

Repository
rC Clang

Event Timeline

NoQ accepted this revision.Mar 7 2018, 3:10 PM
NoQ added inline comments.
lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
58

Uhm. Why does this code bind a value to a non-expression. This old/legacy code would love some cleanup. Could you add a FIXME here? ("We shouldn't bind a value to a non-statement.").

This revision is now accepted and ready to land.Mar 7 2018, 3:10 PM
This revision was automatically updated to reflect the committed changes.