[libc-commits] [libc] [libc][realpath] Implement symbolic path resolution (PR #204467)

Jackson Stogel via libc-commits libc-commits at lists.llvm.org
Tue Jun 30 11:51:21 PDT 2026


================
@@ -23,6 +23,20 @@
 
 namespace LIBC_NAMESPACE_DECL {
 namespace cpp {
+namespace {
+
+char *realloc_or_die(char *ptr, size_t size) {
+  void *new_ptr = ::realloc(ptr, size);
+  if (new_ptr == nullptr) {
+    // Out of memory: this is not handled in current implementation,
+    // We trap the program and exits.
+    __builtin_trap();
+  }
----------------
jtstogel wrote:

I see, done.

https://github.com/llvm/llvm-project/pull/204467


More information about the libc-commits mailing list