Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PK11SlotList *
- PK11_GetAllTokens(....)
- {
- ....
- int j = 0;
- PRInt32 waste[16];
- ....
- #if defined( XP_WIN32 )
- /* This is works around some horrible cache/page thrashing
- ** problems on Win32. Without this, this loop can take up to
- ** 6 seconds at 100% CPU on a Pentium-Pro 200. The thing this
- ** changes is to increase the size of the stack frame and
- ** modify it. Moving the loop code itself seems to have no
- ** effect. Dunno why this combination makes a difference,
- ** but it does.
- */
- waste[j & 0xf] = j++;
- #endif
- ....
- }
- This suspicious code was found in nss project by PVS-Studio static code analyzer.
- Warning message is:
- V567 Undefined behavior. The 'j' variable is modified while being used twice between sequence points. pk11slot.c 1926
- 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