PVS-StudioWarnings

PVS-Studio warning V519 for V8

Nov 11th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. void RBBIRuleScanner::error(UErrorCode e) {
  2.   if (U_SUCCESS(*fRB->fStatus)) {
  3.     *fRB->fStatus = e;
  4.     if (fRB->fParseError) {
  5.       fRB->fParseError->line  = fLineNum;
  6.       fRB->fParseError->offset = fCharNum;
  7.       fRB->fParseError->preContext[0] = 0;
  8.       fRB->fParseError->preContext[0] = 0;
  9.     }
  10.   }
  11. }
  12.  
  13. This suspicious code was found in V8 project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V519 The 'fRB->fParseError->preContext[0]' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 582, 583. rbbiscan.cpp 583
  16.  
  17. 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