Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer pow_ii(integer *ap, integer *bp)
- {
- integer pow, x, n;
- unsigned long u;
- x = *ap;
- n = *bp;
- if (n <= 0)
- {
- if (n == 0 || x == 1)
- return 1;
- if (x != -1)
- return x == 0 ? 1/x : 0;
- n = -n;
- }
- ....
- }
- This suspicious code was found in VNL project by PVS-Studio static code analyzer.
- Warning message is:
- V609 Divide by zero. Denominator 'x' == 0. pow_ii.c 28
- 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