Skip to content

Commit

Permalink
Fix use of invalid iterator
Browse files Browse the repository at this point in the history
This problem is reported by running cppcheck on the generated C++,
 and originated in the python module, see https://sourceforge.net/p/swig/bugs/1347/ .
Unfortunately it propagated through copy pasting to several other modules. 
The fix used here is directly extracted from the code used in the Python module, see https://github.com/swig/swig/blob/2740812970382202fe97e52f7c881eaa71c2e7c0/Lib/python/pycontainer.swg#L329 .
  • Loading branch information
traversaro committed Aug 28, 2016
1 parent aa65c77 commit d509373
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/matlab/matlabcontainer.swg
Expand Up @@ -163,6 +163,8 @@ namespace swig {
std::advance(sb,ii);
std::advance(se,jj);
self->erase(sb,se);
sb = self->begin();
std::advance(sb,ii);
self->insert(sb, v.begin(), v.end());
}
}
Expand Down

0 comments on commit d509373

Please sign in to comment.