Skip to content

Commit

Permalink
[sanitizer_common] Remove unnecessary const_cast
Browse files Browse the repository at this point in the history
This used to be required because rlim was declared volatile, but commit
d657f10 removed that workaround.
  • Loading branch information
arichardson committed Mar 3, 2024
1 parent e29cad6 commit 5f70f25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 5f70f25

Please sign in to comment.