diff options
author | albert-github <albert.tests@gmail.com> | 2021-03-20 16:48:12 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2021-03-20 16:48:12 (GMT) |
commit | 2059db4f1b1662a28a7ba3ac714bae43947899b8 (patch) | |
tree | 2258dfd8445a93df127893f07c44c37b8cdb1eee /src | |
parent | 07d04c093b3070118a9d24b2c346a65c3f16da6b (diff) | |
download | Doxygen-2059db4f1b1662a28a7ba3ac714bae43947899b8.zip Doxygen-2059db4f1b1662a28a7ba3ac714bae43947899b8.tar.gz Doxygen-2059db4f1b1662a28a7ba3ac714bae43947899b8.tar.bz2 |
Regression: dead code in classdef.cpp
According to coverity:
```
assignment: Assigning: firstSpan = true.
3037 bool firstSpan=true;
3038 for (const auto &s : sl)
3039 {
cond_const: Condition firstSpan, taking true branch. Now the value of firstSpan is equal to 1.
const: At condition firstSpan, the value of firstSpan must be equal to 1.
dead_error_condition: The condition !firstSpan cannot be true.
3040 if (!firstSpan)
3041 {
CID 315162 (#1 of 1): Logically dead code (DEADCODE)dead_error_begin: Execution cannot reach this statement: ol->writeString("</span><sp....
3042 ol.writeString("</span><span class=\"mlabel\">");
3043 firstSpan=false;
3044 }
```
this problem has been introduced in: Refactoring: Replaced QDir with Dir (Commit: 0d05e79d67b5b808918541f429b06805207e8bdb)
Reformulated loop and condition, also it is not guaranteed that the list contains a member so adjested also for an empty list/
Diffstat (limited to 'src')
-rw-r--r-- | src/classdef.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index f1d9c60..17b9acb 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -2998,7 +2998,6 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const ) && memberWritten) { - ol.writeString("<span class=\"mlabel\">"); StringVector sl; if (lang==SrcLangExt_VHDL) { @@ -3040,11 +3039,15 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const if (!firstSpan) { ol.writeString("</span><span class=\"mlabel\">"); + } + else + { + ol.writeString("<span class=\"mlabel\">"); firstSpan=false; } ol.docify(s.c_str()); } - ol.writeString("</span>"); + if (!firstSpan) ol.writeString("</span>"); } if (memberWritten) { |