https://github.com/igorkudrin updated 
https://github.com/llvm/llvm-project/pull/151635

>From e6bb5f48978f4eabc9e49176eb3ffd04f2f0e66c Mon Sep 17 00:00:00 2001
From: Igor Kudrin <ikud...@accesssoftek.com>
Date: Thu, 31 Jul 2025 20:39:15 -0700
Subject: [PATCH 1/2] [lldb] Ensure that TestMemoryCache.py reads allocated
 memory

The test reads 400 bytes of memory above the local variable. If the
stack is shallow, this can reach non-allocated space, resulting in a
test failure.
---
 lldb/test/API/functionalities/memory/cache/main.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lldb/test/API/functionalities/memory/cache/main.cpp 
b/lldb/test/API/functionalities/memory/cache/main.cpp
index 44d85c5e9d2c3..a539e48c2cdf4 100644
--- a/lldb/test/API/functionalities/memory/cache/main.cpp
+++ b/lldb/test/API/functionalities/memory/cache/main.cpp
@@ -1,5 +1,11 @@
-int main ()
+int test()
 {
     int my_ints[] = {0x42};
     return 0; // Set break point at this line.
 }
+
+int main ()
+{
+    int dummy[100];
+    return test();
+}

>From e11de6b5ae1c0e72ee6bad7edf1aa6dd6df84378 Mon Sep 17 00:00:00 2001
From: Igor Kudrin <ikud...@accesssoftek.com>
Date: Thu, 31 Jul 2025 20:58:03 -0700
Subject: [PATCH 2/2] fixup! formatting

---
 .../test/API/functionalities/memory/cache/main.cpp | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/lldb/test/API/functionalities/memory/cache/main.cpp 
b/lldb/test/API/functionalities/memory/cache/main.cpp
index a539e48c2cdf4..5d2683f7adf94 100644
--- a/lldb/test/API/functionalities/memory/cache/main.cpp
+++ b/lldb/test/API/functionalities/memory/cache/main.cpp
@@ -1,11 +1,9 @@
-int test()
-{
-    int my_ints[] = {0x42};
-    return 0; // Set break point at this line.
+int test() {
+  int my_ints[] = {0x42};
+  return 0; // Set break point at this line.
 }
 
-int main ()
-{
-    int dummy[100];
-    return test();
+int main() {
+  int dummy[100];
+  return test();
 }

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to