This is an archive of the discontinued LLVM Phabricator instance.

[scan-build] fix warnings emitted on LLVM dsymutil code base
Needs ReviewPublic

Authored by apelete on May 5 2016, 7:04 AM.

Details

Summary

Fix a logic error warning of the type "called C++ object pointer is
null" emitted by Clang Static Analyzer on the following file:

  • tools/dsymutil/DwarfLinker.cpp.

Signed-off-by: Apelete Seketeli <apelete@seketeli.net>

Diff Detail

Event Timeline

apelete updated this revision to Diff 56281.May 5 2016, 7:04 AM
apelete retitled this revision from to [scan-build] fix warnings emitted on LLVM dsymutil code base.
apelete added reviewers: dexonsmith, aprantl.
apelete updated this object.
apelete added a subscriber: llvm-commits.
friss added a subscriber: friss.May 5 2016, 12:57 PM

Attr can never be null here because one of Loc or Block will be non-null. This looks like a deficiency of the static analyzer. I'd rather initialize Attr in each of the branches of the if above if that helps.

Attr can never be null here because one of Loc or Block will be non-null. This looks like a deficiency of the static analyzer. I'd rather initialize Attr in each of the branches of the if above if that helps.

Tried initializing Attr in each of the if() branches and it didn't help with the warning.
I guess the warning in this file could be ignored since Attr is expected to never be null.

dexonsmith resigned from this revision.Oct 19 2020, 2:54 PM

Is this still relevant?