Advertisement
PVS-StudioWarnings

PVS-Studio warning V567 for Source SDK

Nov 24th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. int m_nNewSequenceParity;
  2. int m_nResetEventsParity;
  3.  
  4. void C_BaseAnimating::ResetSequenceInfo( void )
  5. {
  6.   ....
  7.   m_nNewSequenceParity =
  8.     ( ++m_nNewSequenceParity ) & EF_PARITY_MASK;
  9.   m_nResetEventsParity =
  10.     ( ++m_nResetEventsParity ) & EF_PARITY_MASK;
  11.   ....
  12. }
  13.  
  14. This suspicious code was found in Source SDK project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V567 Undefined behavior. The 'm_nNewSequenceParity' variable is modified while being used twice between sequence points. Client (HL2) c_baseanimating.cpp 5301
  17.  
  18. 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
Advertisement