[compiler-rt] Extend GetMaxVirtualAddress heuristic with code addresses (PR #225552)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 16:47:40 PDT 2026


================
@@ -1247,7 +1247,14 @@ uptr GetMaxVirtualAddress() {
   // Similarly, aarch64 has multiple address space layouts: 39, 42 and 47-bit.
   // loongarch64 also has multiple address space layouts: default is 47-bit.
   // RISC-V 64 also has multiple address space layouts: 39, 48 and 57-bit.
-  return (1ULL << (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1)) - 1;
+  //
+  // We've seen qemu-user emulation put code above the frame addres, so the
----------------
thurstond wrote:

Also, please mention that it was specifically observed on aarch64 qemu-user, in case anyone tries reproducing the behavior on the other platforms that are covered by this `#if`.

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


More information about the llvm-commits mailing list