[compiler-rt] [win/asan] AllocateMemoryForTrampoline within 2 GB of the module's base address (PR #108822)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 02:15:19 PDT 2024


================
@@ -385,7 +386,29 @@ void TestOnlyReleaseTrampolineRegions() {
   }
 }
 
-static uptr AllocateMemoryForTrampoline(uptr image_address, size_t size) {
+static uptr AllocateMemoryForTrampoline(uptr func_address, size_t size) {
+  uptr image_address = func_address;
+
+#if SANITIZER_WINDOWS64
+  // Since we may copy code to the trampoline which could reference data
----------------
zmodem wrote:

I've updated the comment.

As for doing the interval comparison, I'm thinking about rewriting `AllocateTrampolineRegion` so that it also considers memory at lower addresses. That would help if the address space is crowded, and for that we'd need to do the interval comparisons. But I'd like to consider that as a separate change.

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


More information about the llvm-commits mailing list