[PATCH] D40463: [analyzer] Fix false negative on post-increment of uninitialized variable.

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 26 01:19:08 PST 2017


lebedev.ri created this revision.
lebedev.ri added a project: clang.
Herald added subscribers: a.sidorin, szepet, xazax.hun.

Currently clang static analyzer does warn on:

  int x;
  x+=1;
  x-=1;
  x=x+1;
  x=x-1;

But does warn on:

  int x;
  x++;
  x--;
  --x;
  ++x;

This differential should fix that.
Fixes https://bugs.llvm.org/show_bug.cgi?id=35419


Repository:
  rL LLVM

https://reviews.llvm.org/D40463

Files:
  docs/ReleaseNotes.rst
  lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
  lib/StaticAnalyzer/Core/ExprEngineC.cpp
  test/Analysis/malloc-plist.c
  test/Analysis/objc-for.m
  test/Analysis/uninit-const.c
  test/Analysis/uninit-const.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40463.124279.patch
Type: text/x-patch
Size: 230760 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171126/5b66fd80/attachment-0001.bin>


More information about the cfe-commits mailing list