[compiler-rt] [scudo] Move getResidentPages function (PR #183138)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 13:04:03 PST 2026


================
@@ -75,6 +75,34 @@ TEST(ScudoMapDeathTest, MapWithGuardUnmap) {
   MemMap.unmap();
 }
 
+// These death tests only fail when debugging is enabled.
+#if SCUDO_DEBUG && SCUDO_LINUX
+TEST(ScudoMapDeathTest, ResidentPagesNotMapped) {
+  scudo::MemMapT MemMap;
+  EXPECT_DEATH(MemMap.getResidentPages(), "");
+}
+#endif
----------------
ChiaHungDuan wrote:

Why do we want this to crash? For example, if a region is never used, so it never maps any pages. When we iterate regions, this will cause the program to stop. I thought it can just return 0, right?

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


More information about the llvm-commits mailing list