diff options
Diffstat (limited to 'compiler-rt')
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_defs.h | 1 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_flags.cc | 2 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_interceptors.cc | 4 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_md5.cc | 6 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc | 2 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_suppressions.cc | 2 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_symbolize_addr2line_linux.cc | 8 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_sync.cc | 2 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_vector.h | 2 |
9 files changed, 17 insertions, 12 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_defs.h b/compiler-rt/lib/tsan/rtl/tsan_defs.h index d2a5ce7d813..76895d64305 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_defs.h +++ b/compiler-rt/lib/tsan/rtl/tsan_defs.h @@ -135,6 +135,7 @@ T RoundUp(T p, int align) { } void real_memset(void *ptr, int c, uptr size); +void real_memcpy(void *dst, const void *src, uptr size); int internal_memcmp(const void *s1, const void *s2, uptr size); int internal_strncmp(const char *s1, const char *s2, uptr size); void internal_strcpy(char *s1, const char *s2); diff --git a/compiler-rt/lib/tsan/rtl/tsan_flags.cc b/compiler-rt/lib/tsan/rtl/tsan_flags.cc index afad9bb766b..2268d6a45cb 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_flags.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_flags.cc @@ -139,7 +139,7 @@ static void Flag(const char *env, const char **flag, const char *name) { return; int len = end - val; char *f = (char*)internal_alloc(MBlockFlag, len + 1); - internal_memcpy(f, val, len); + real_memcpy(f, val, len); f[len] = 0; *flag = f; } diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc index 9114e76ea65..35ab0beacb7 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc @@ -1525,6 +1525,10 @@ void real_memset(void *ptr, int c, uptr size) { REAL(memset)(ptr, c, size); } +void real_memcpy(void *dst, const void *src, uptr size) { + REAL(memcpy)(dst, src, size); +} + int internal_memcmp(const void *s1, const void *s2, uptr size) { return REAL(memcmp)(s1, s2, size); } diff --git a/compiler-rt/lib/tsan/rtl/tsan_md5.cc b/compiler-rt/lib/tsan/rtl/tsan_md5.cc index aeae302df6e..c2074c0665f 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_md5.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_md5.cc @@ -166,11 +166,11 @@ void MD5_Update(MD5_CTX *ctx, void *data, ulong_t size) { free = 64 - used; if (size < free) { - internal_memcpy(&ctx->buffer[used], data, size); + real_memcpy(&ctx->buffer[used], data, size); return; } - internal_memcpy(&ctx->buffer[used], data, free); + real_memcpy(&ctx->buffer[used], data, free); data = (unsigned char *)data + free; size -= free; body(ctx, ctx->buffer, 64); @@ -181,7 +181,7 @@ void MD5_Update(MD5_CTX *ctx, void *data, ulong_t size) { size &= 0x3f; } - internal_memcpy(ctx->buffer, data, size); + real_memcpy(ctx->buffer, data, size); } void MD5_Final(unsigned char *result, MD5_CTX *ctx) { diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc index 147e383b63c..7f6d69bd244 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc @@ -212,7 +212,7 @@ void ThreadFinish(ThreadState *thr) { // Save from info about the thread. tctx->dead_info = new(internal_alloc(MBlockDeadInfo, sizeof(ThreadDeadInfo))) ThreadDeadInfo(); - internal_memcpy(&tctx->dead_info->trace.events[0], + real_memcpy(&tctx->dead_info->trace.events[0], &thr->trace.events[0], sizeof(thr->trace.events)); for (int i = 0; i < kTraceParts; i++) { tctx->dead_info->trace.headers[i].stack0.CopyFrom( diff --git a/compiler-rt/lib/tsan/rtl/tsan_suppressions.cc b/compiler-rt/lib/tsan/rtl/tsan_suppressions.cc index d4c37e1ad75..ced6591824d 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_suppressions.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_suppressions.cc @@ -118,7 +118,7 @@ Suppression *SuppressionParse(const char* supp) { head = s; s->type = stype; s->templ = (char*)internal_alloc(MBlockSuppression, end2 - line + 1); - internal_memcpy(s->templ, line, end2 - line); + real_memcpy(s->templ, line, end2 - line); s->templ[end2 - line] = 0; } if (end[0] == 0) diff --git a/compiler-rt/lib/tsan/rtl/tsan_symbolize_addr2line_linux.cc b/compiler-rt/lib/tsan/rtl/tsan_symbolize_addr2line_linux.cc index 71ba7cd86a7..6a445c2a74d 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_symbolize_addr2line_linux.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_symbolize_addr2line_linux.cc @@ -179,12 +179,12 @@ ReportStack *SymbolizeCode(uptr addr) { char *pos = (char*)internal_strchr(func, '\n'); if (pos && func[0] != '?') { res->func = (char*)internal_alloc(MBlockReportStack, pos - func + 1); - internal_memcpy(res->func, func, pos - func); + real_memcpy(res->func, func, pos - func); res->func[pos - func] = 0; char *pos2 = (char*)internal_strchr(pos, ':'); if (pos2) { res->file = (char*)internal_alloc(MBlockReportStack, pos2 - pos - 1 + 1); - internal_memcpy(res->file, pos + 1, pos2 - pos - 1); + real_memcpy(res->file, pos + 1, pos2 - pos - 1); res->file[pos2 - pos - 1] = 0; res->line = atoi(pos2 + 1); } @@ -215,14 +215,14 @@ ReportStack *SymbolizeData(uptr addr) { symb[0].module = 0; symb[0].offset = addr; symb[0].name = alloc->Alloc<char>(pos - tmp + 1); - internal_memcpy(symb[0].name, tmp, pos - tmp); + real_memcpy(symb[0].name, tmp, pos - tmp); symb[0].name[pos - tmp] = 0; symb[0].file = 0; symb[0].line = 0; char *pos2 = strchr(pos, ':'); if (pos2) { symb[0].file = alloc->Alloc<char>(pos2 - pos - 1 + 1); - internal_memcpy(symb[0].file, pos + 1, pos2 - pos - 1); + real_memcpy(symb[0].file, pos + 1, pos2 - pos - 1); symb[0].file[pos2 - pos - 1] = 0; symb[0].line = atoi(pos2 + 1); } diff --git a/compiler-rt/lib/tsan/rtl/tsan_sync.cc b/compiler-rt/lib/tsan/rtl/tsan_sync.cc index e917c5baf15..36b316ade65 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_sync.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_sync.cc @@ -155,7 +155,7 @@ void StackTrace::Init(const uptr *pcs, uptr cnt) { return; n_ = cnt; s_ = (uptr*)internal_alloc(MBlockStackTrace, cnt * sizeof(s_[0])); - internal_memcpy(s_, pcs, cnt * sizeof(s_[0])); + real_memcpy(s_, pcs, cnt * sizeof(s_[0])); } void StackTrace::ObtainCurrent(ThreadState *thr, uptr toppc) { diff --git a/compiler-rt/lib/tsan/rtl/tsan_vector.h b/compiler-rt/lib/tsan/rtl/tsan_vector.h index d41063df3de..5b6998f51ee 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_vector.h +++ b/compiler-rt/lib/tsan/rtl/tsan_vector.h @@ -94,7 +94,7 @@ class Vector { cap = size; T *p = (T*)internal_alloc(typ_, cap * sizeof(T)); if (cap0) { - internal_memcpy(p, begin_, cap0 * sizeof(T)); + real_memcpy(p, begin_, cap0 * sizeof(T)); internal_free(begin_); } begin_ = p; |

