Skip to content

Commit a2eacb3

Browse files
committedSep 27, 2017
[ARM] builtins: Replace abort by assert in clear_cache.
Summary: __builtion___clear_cache maps to clear_cache function. On Linux, clear_cache functions makes a syscall and does an abort if syscall fails. Replace the abort by an assert so that non-debug builds do not abort if the syscall fails. Fixes PR34588. Reviewers: rengolin, compnerd, srhines, peter.smith, joerg Reviewed By: rengolin Subscribers: aemerson, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D37788 llvm-svn: 314322
1 parent 1e053ab commit a2eacb3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎compiler-rt/lib/builtins/clear_cache.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
#include "int_lib.h"
12+
#include <assert.h>
1213
#include <stddef.h>
1314

1415
#if __APPLE__
@@ -121,9 +122,7 @@ void __clear_cache(void *start, void *end) {
121122
: "=r"(start_reg)
122123
: "r"(syscall_nr), "r"(start_reg), "r"(end_reg),
123124
"r"(flags));
124-
if (start_reg != 0) {
125-
compilerrt_abort();
126-
}
125+
assert(start_reg == 0 && "Cache flush syscall failed.");
127126
#elif defined(_WIN32)
128127
FlushInstructionCache(GetCurrentProcess(), start, end - start);
129128
#else

0 commit comments

Comments
 (0)