[PATCH] libstdc++: Make forward_list::sort exception-safe [PR124051]
Odysseas Georgoudis
odygrd@hotmail.com
Sun Aug 16 20:43:05 GMT 2026
If a comparison called by forward_list::sort throws, the current
implementation can leave the list corrupted, which may cause a later
crash.
This patch restores valid links before allowing the same exception to
continue. The element order remains unspecified, as permitted by the
standard, while iterators and references remain valid.
Tested on x86_64-pc-linux-gnu.
Thanks,
Odysseas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20260816/23c998a3/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR124051.patch
Type: application/octet-stream
Size: 6382 bytes
Desc: PR124051.patch
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20260816/23c998a3/attachment.obj>
More information about the Libstdc++
mailing list