PVS-StudioWarnings

PVS-Studio warning V537 for Source SDK

Nov 10th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. class ALIGN16 FourVectors
  2. {
  3. public:
  4.   fltx4 x, y, z;
  5.   ....
  6. };
  7.  
  8. FourVectors BackgroundColor;
  9.  
  10. void RayTracingEnvironment::RenderScene(....)
  11. {
  12.   ....
  13.   intens.x=OrSIMD(AndSIMD(BackgroundColor.x,no_hit_mask),
  14.                   AndNotSIMD(no_hit_mask,intens.x));
  15.   intens.y=OrSIMD(AndSIMD(BackgroundColor.y,no_hit_mask),
  16.                   AndNotSIMD(no_hit_mask,intens.y));
  17.   intens.z=OrSIMD(AndSIMD(BackgroundColor.y,no_hit_mask),
  18.                   AndNotSIMD(no_hit_mask,intens.z));
  19.  
  20.   ....
  21. }
  22.  
  23. This is what should have been written here: intens.z=OrSIMD(AndSIMD(BackgroundColor.z,no_hit_mask), AndNotSIMD(no_hit_mask,intens.z));
  24.  
  25. This suspicious code was found in Source SDK project by PVS-Studio static code analyzer.
  26. Warning message is:
  27. V537 Consider reviewing the correctness of 'y' item's usage. Raytrace trace2.cpp 189
  28.  
  29. 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