Issue 125188
Summary [libc++] basic_string::max_size() is broken for small sizes
Labels libc++
Assignees
Reporter philnik777
    `max_size()` currently checks if the allocator's `max_size() <= numeric_limits<size_type>::max() / 2`, but then subtracts an alignment, causing an overflow for values less than the alignment. We should probably just diagnose when the `max_size()` of the allocator is so small that our string implementation is just broken (e.g. `max_size() < SSO size`).
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to