Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CCacheFileOutBuffer::~CCacheFileOutBuffer()
- {
- if (IsOpen())
- {
- streamOffsets.push_back (GetFileSize());
- size_t lastOffset = streamOffsets[0];
- for (size_t i = 1,
- count = streamOffsets.size();
- i < count; ++i)
- {
- size_t offset = streamOffsets[i];
- size_t size = offset - lastOffset;
- if (size >= (DWORD)(-1))
- throw CStreamException("stream too large");
- Add ((DWORD)size);
- lastOffset = offset;
- }
- Add ((DWORD)(streamOffsets.size()-1));
- }
- }
- This suspicious code was found in TortoiseSVN project by PVS-Studio static code analyzer.
- Warning message is:
- V509 The 'throw' operator inside the destructor should be placed within the try..catch block. Raising exception inside the destructor is illegal. cachefileoutbuffer.cpp 52
- 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