]> granicus.if.org Git - clang/commit
Delete a trivially true check for a variable 'S' being null.
authorChandler Carruth <chandlerc@gmail.com>
Fri, 4 Nov 2016 06:16:09 +0000 (06:16 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 4 Nov 2016 06:16:09 +0000 (06:16 +0000)
commitf4b4bc99007592cd2b90e2e69d51149a7c34552b
treebc0d4049a201202310b5a1db68b192e9953e15d2
parentbff9f7176a483c4f85fe486ad38eddd700deffb2
Delete a trivially true check for a variable 'S' being null.

The exact same test guards entry into the loop in which this test
occurs, and there is nothing inside the loop that assigns to the
variable, so it has already been checked for null.

This was flagged by PVS-Studio as well, but the report is actually wrong
-- this is not a case where we dereference a variable prior to testing
it for null, this is a case where we have a redundant test for null
after we already performed the exact same test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285983 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaLookup.cpp