PVS-StudioWarnings

PVS-Studio warning V612 for dmd-project

Nov 12th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. code *cdvector(elem *e, regm_t *pretregs)
  2. {
  3.   ....
  4.   code *c = CNIL;
  5.   for (int i = 0; i < n; i++)
  6.   {
  7.     c = cat(c, codelem(params[i], pretregs, FALSE));
  8.     *pretregs = 0;      // in case they got set
  9.     return c;
  10.   }
  11.   ....
  12. }
  13.  
  14. This suspicious code was found in dmd-project project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V612 An unconditional 'return' within a loop. cgxmm.c 825
  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