Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <> struct SmiTagging<8> {
- static const int kSmiShiftSize = 31;
- static const int kSmiValueSize = 32;
- V8_INLINE static int SmiToInt(internal::Object* value) {
- int shift_bits = kSmiTagSize + kSmiShiftSize;
- return static_cast<int>(reinterpret_cast<intptr_t>(value) >>
- shift_bits);
- }
- ....
- }
- This suspicious code was found in V8 project by PVS-Studio static code analyzer.
- Warning message is:
- V610 Undefined behavior. Check the shift operator '>>. The right operand 'shift_bits' is greater than or equal to the length in bits of the promoted left operand. v8.h 5343
- 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