[all-commits] [llvm/llvm-project] 1949f7: [scudo] Clean up string handling (#86364)

Christopher Ferris via All-commits all-commits at lists.llvm.org
Tue Mar 26 14:48:10 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1949f7d6c9bd59172c01c7933e1c558797c47eac
      https://github.com/llvm/llvm-project/commit/1949f7d6c9bd59172c01c7933e1c558797c47eac
  Author: Christopher Ferris <cferris1000 at users.noreply.github.com>
  Date:   2024-03-26 (Tue, 26 Mar 2024)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/fuchsia.cpp
    M compiler-rt/lib/scudo/standalone/mem_map_fuchsia.cpp
    M compiler-rt/lib/scudo/standalone/report_linux.cpp
    M compiler-rt/lib/scudo/standalone/string_utils.cpp
    M compiler-rt/lib/scudo/standalone/string_utils.h
    M compiler-rt/lib/scudo/standalone/tests/strings_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/vector_test.cpp
    M compiler-rt/lib/scudo/standalone/vector.h

  Log Message:
  -----------
  [scudo] Clean up string handling (#86364)

Do not abort if a vector cannot increase its own capacity. In that case,
push_back calls silently fail.

Modify the ScopedString implementation so that it no longer requires two
passes to do the format. Move the helper functions to be private member
functions so that they can use push_back directly. This allows the
capacity to be increased under the hood and/or silently discards data if
the capacity is exceeded and cannot be increased.

Add new tests for the Vector and ScopedString for capacity increase
failures.

Doing this so that if a map call fails, and we are attempting to write
an error string, we can still get some of the message dumped. This also
avoids crashing in Scudo code, and makes the caller handle any failures.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list