summaryrefslogtreecommitdiff
path: root/lib/builtins/clear_cache.c
diff options
context:
space:
mode:
authorManoj Gupta <manojgupta@google.com>2017-09-27 17:36:25 +0000
committerManoj Gupta <manojgupta@google.com>2017-09-27 17:36:25 +0000
commit3ac72d80925e1bc74dfafec727263e4ae45d14fd (patch)
tree81a87ac9795bba129a2b7553180ee3eb8f874f8e /lib/builtins/clear_cache.c
parent9dae4270dd0b0ac280ca5b50393e25841b911377 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/builtins/clear_cache.c')
-rw-r--r--lib/builtins/clear_cache.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/builtins/clear_cache.c b/lib/builtins/clear_cache.c
index e21ac08f8..640cb7572 100644
--- a/lib/builtins/clear_cache.c
+++ b/lib/builtins/clear_cache.c
@@ -9,6 +9,7 @@
*/
#include "int_lib.h"
+#include <assert.h>
#include <stddef.h>
#if __APPLE__
@@ -121,9 +122,7 @@ void __clear_cache(void *start, void *end) {
: "=r"(start_reg)
: "r"(syscall_nr), "r"(start_reg), "r"(end_reg),
"r"(flags));
- if (start_reg != 0) {
- compilerrt_abort();
- }
+ assert(start_reg == 0 && "Cache flush syscall failed.");
#elif defined(_WIN32)
FlushInstructionCache(GetCurrentProcess(), start, end - start);
#else