Page MenuHomePhabricator

[analyzer] ConditionBRVisitor: Treat enums as unknown
Needs ReviewPublic

Authored by Charusso on Apr 14 2019, 9:10 AM.

Details

Reviewers
NoQ
Summary
  • We do not model enums so removed from ConditionBRVisitor::patternMatch().
  • Refactored that function.

Diff Detail

Event Timeline

Charusso created this revision.Apr 14 2019, 9:10 AM
Charusso added a project: Restricted Project.Apr 14 2019, 9:11 AM
Charusso marked 2 inline comments as done.

This error found in D59155.

clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
2095

That was the point when we catch a DRE and we said that it is a variable.

clang/test/Analysis/keychainAPI-diagnostic-visitor.m
30

DeclRefExpr 0x67b308 'OSStatus':'unsigned int' lvalue Var 0x657aa8 'st' 'OSStatus':'unsigned int'
and
DeclRefExpr 0x67b328 'int' EnumConstant 0x657228 'noErr' 'int'

@NoQ, this is my last patch, just we bumped into that randomly, it would be cool to fix that.