[compiler-rt] 5f70f25 - [sanitizer_common] Remove unnecessary const_cast
Alex Richardson via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 2 19:43:27 PST 2024
Author: Alex Richardson
Date: 2024-03-02T19:43:05-08:00
New Revision: 5f70f253c2b8978b50d20d37b25591b40dfe38d5
URL: https://github.com/llvm/llvm-project/commit/5f70f253c2b8978b50d20d37b25591b40dfe38d5
DIFF: https://github.com/llvm/llvm-project/commit/5f70f253c2b8978b50d20d37b25591b40dfe38d5.diff
LOG: [sanitizer_common] Remove unnecessary const_cast
This used to be required because rlim was declared volatile, but commit
d657f109d7080bd51ad70e88859acf64931152fe removed that workaround.
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
index e88e654eec5a1c..ef1fc354974396 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
@@ -91,12 +91,12 @@ static rlim_t getlim(int res) {
static void setlim(int res, rlim_t lim) {
struct rlimit rlim;
- if (getrlimit(res, const_cast<struct rlimit *>(&rlim))) {
+ if (getrlimit(res, &rlim)) {
Report("ERROR: %s getrlimit() failed %d\n", SanitizerToolName, errno);
Die();
}
rlim.rlim_cur = lim;
- if (setrlimit(res, const_cast<struct rlimit *>(&rlim))) {
+ if (setrlimit(res, &rlim)) {
Report("ERROR: %s setrlimit() failed %d\n", SanitizerToolName, errno);
Die();
}
More information about the llvm-commits
mailing list