Fix logic error warnings of the type "called C++ object pointer is
null" emitted by Clang Static Analyzer on the following file:
- lib/MC/MCParser/AsmParser.cpp.
Signed-off-by: Apelete Seketeli <apelete@seketeli.net>
Differential D19970
[scan-build] fix warnings emitted on LLVM MachineCode code base apelete on May 5 2016, 6:44 AM. Authored by
Details
Fix logic error warnings of the type "called C++ object pointer is
Signed-off-by: Apelete Seketeli <apelete@seketeli.net>
Diff Detail Event TimelineComment Actions Let's see:
Here the analyzer seems to be complaining about the fact that the pointer to MCSection type (which is the first element of MCSectionSubPair type that is returned by getStreamer().getCurrentSection().first) might be nullptr. I understand that there is a code path that takes care of such an initialization, but from static analysis point of view that particular code path might not have been taken at this point. Should I assert Sec value before if (!Sec->getBeginSymbol()) ? |