Fix a logic error warning of the type "assigned value is garbage or
undefined" emitted by Clang Static Analyzer on the following file:
- lib/Bitcode/Writer/BitcodeWriter.cpp.
Signed-off-by: Apelete Seketeli <apelete@seketeli.net>
Differential D19975
[scan-build] fix warning emitted on LLVM Bitcode code base apelete on May 5 2016, 7:42 AM. Authored by
Details
Diff Detail Event TimelineComment Actions
What does this error mean? It seems like a case where we would get a maybe uninitialized warning, if -Wmaybe-uninitialized was enabled (but its my understanding that there is a conscious decision not to enable this warning for llvm). In this case, we have assertion checks (noted below) that ensure we never use these without initializing them. If we need to fix this case to silence an analyzer, I'd rather initialize those abbrevs to 0 and add an assert down near the uses that they are non-zero (as noted below the default added in this patch doesn't make sense for this bitcode record type).
Comment Actions [scan-build] fix warning emitted on LLVM Bitcode code base Changes since last revision:
|
These are not correct abbrev ids for this code.