[llvm-commits] [compiler-rt] r166775 - /compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc
Alexander Potapenko
glider at google.com
Fri Oct 26 06:47:36 PDT 2012
Author: glider
Date: Fri Oct 26 08:47:36 2012
New Revision: 166775
URL: http://llvm.org/viewvc/llvm-project?rev=166775&view=rev
Log:
Fix a compiler warning in internal_memmove.
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc?rev=166775&r1=166774&r2=166775&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc Fri Oct 26 08:47:36 2012
@@ -47,14 +47,14 @@
void *internal_memmove(void *dest, const void *src, uptr n) {
char *d = (char*)dest;
char *s = (char*)src;
- sptr i = (sptr)n;
- CHECK_GE(i, 0);
+ sptr i, signed_n = (sptr)n;
+ CHECK_GE(signed_n, 0);
if (d < s) {
- for (i = 0; i < n; ++i)
+ for (i = 0; i < signed_n; ++i)
d[i] = s[i];
} else {
- if (d > s && n > 0)
- for (i = n - 1; i >= 0 ; --i) {
+ if (d > s && signed_n > 0)
+ for (i = signed_n - 1; i >= 0 ; --i) {
d[i] = s[i];
}
}
More information about the llvm-commits
mailing list