PVS-StudioWarnings

PVS-Studio warning V501 for Firefox

Nov 17th, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. bool
  2. nsHTMLCSSUtils::IsCSSEditableProperty(....)
  3. {
  4.   ....
  5.   if (aAttribute && aAttribute->EqualsLiteral("align") &&
  6.       (nsEditProperty::ul == tagName                       <<<===
  7.        || nsEditProperty::ol == tagName
  8.        || nsEditProperty::dl == tagName
  9.        || nsEditProperty::li == tagName
  10.        || nsEditProperty::dd == tagName
  11.        || nsEditProperty::dt == tagName
  12.        || nsEditProperty::address == tagName
  13.        || nsEditProperty::pre == tagName
  14.        || nsEditProperty::ul == tagName)) {                <<<===
  15.     return true;
  16.   }
  17.   ....
  18. }
  19.  
  20. This suspicious code was found in Firefox project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V501 There are identical sub-expressions 'nsEditProperty::ul == tagName' to the left and to the right of the '||' operator. nshtmlcssutils.cpp 432
  23.  
  24. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment