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

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

https://gcc.gnu.org/g:99f992a275c30bc8db2e6352e98ab81c89b5b7ed

commit r12-9977-g99f992a275c30bc8db2e6352e98ab81c89b5b7ed
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.

    (cherry picked from commit 4db820928065eccbeb725406450d826186582b9f)

Reply via email to