[compiler-rt] [scudo] Clean up string handling (PR #86364)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 27 09:47:09 PDT 2024
================
@@ -123,3 +127,31 @@ TEST(ScudoStringsTest, Padding) {
testAgainstLibc<int>("%03d - %03d", 12, 1234);
testAgainstLibc<int>("%03d - %03d", -12, -1234);
}
+
+#if defined(__linux__)
+#include <sys/resource.h>
+
+TEST(ScudoStringsTest, CapacityIncreaseFails) {
+ scudo::ScopedString Str;
+
+ rlimit Limit = {};
+ EXPECT_EQ(0, getrlimit(RLIMIT_AS, &Limit));
+ rlimit EmptyLimit = {.rlim_max = Limit.rlim_max};
----------------
RKSimon wrote:
@cferris1000 I'm assuming we need something like this (not near a linux box atm to test it)
```c
rlimit EmptyLimit = {.rlim_cur = 0, .rlim_max = Limit.rlim_max};
```
https://github.com/llvm/llvm-project/pull/86364
More information about the llvm-commits
mailing list