https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112491

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>:

https://gcc.gnu.org/g:4db820928065eccbeb725406450d826186582b9f

commit r14-5450-g4db820928065eccbeb725406450d826186582b9f
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Tue Nov 14 15:08:13 2023 +0000

    libstdc++: Fix std::deque::size() Xmethod [PR112491]

    The Xmethod for std::deque::size() assumed that the first element would
    be at the start of the first node. That's only true if elements are only
    added at the back. If an element is inserted at the front, or removed
    from the front (or anywhere before the middle) then the first node will
    not be completely populated, and the Xmethod will give the wrong result.

    libstdc++-v3/ChangeLog:

            PR libstdc++/112491
            * python/libstdcxx/v6/xmethods.py (DequeWorkerBase.size): Fix
            calculation to use _M_start._M_cur.
            * testsuite/libstdc++-xmethods/deque.cc: Check failing cases.

Reply via email to