[Boost-bugs] [Boost C++ Libraries] #2478: Invalid assert in boost::filesystem::path::iterator

Subject: [Boost-bugs] [Boost C++ Libraries] #2478: Invalid assert in boost::filesystem::path::iterator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-11-05 15:45:02


#2478: Invalid assert in boost::filesystem::path::iterator
---------------------------------------------------------------+------------
 Reporter: Raffi Enficiaud <raffi.enficiaud_at_[hidden]> | Type: Bugs
   Status: new | Milestone: Boost 1.38.0
Component: None | Version: Boost 1.36.0
 Severity: Problem | Keywords:
---------------------------------------------------------------+------------
 The following code asserts (fs = boost::filesystem)


 //**** Code begin

 fs::path p1("/tmp/unit/repertoire"), p2("/tmp/unit/repertoire/.");

 fs::path::iterator it1 = p1.begin(), it1e = p1.end(),
 it2 = p2.begin(), it2e = p2.end();

 for(; (*it1 == *it2) && (it2 != it2e) && (it1 != it1e); ++it1, ++it2)
 {}

 p2 = "";

 while(it2 != it2e)
 {
  p2 /= *it2;

  ++it2; // <- asserts on this line (first pass)
 }

 //**** Code end

 The assertion (DEBUG defined) is thrown on line 1342 inside file
 "boost/filesystem/path.hpp".
 Basically, the assert checks if the increment it outside of the range of
 iteration. However, after checking it2 != it2e, I should be able to
 increment it (but not the dereference it). Moreover, if
 it2 != it2e, I should be able to call ++it2.

 The environnement is the following :
 - Windows XP (on virtual box)
 - Visual C++ express 2008 (version 9.0.21022.8 RTM)
 - Boost 1.37 (I think it is the same with 1.36)

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2478>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC