Skip to content

Commit 82694d9

Browse files
committed
[compiler-rt][asan] Silence MSVC warning
``` [3/56] Building CXX object projects\compiler-rt\lib\asan\CMakeFiles\RTAsan.x86_64.dir\asan_poisoning.cpp.obj C:\git\llvm-project\compiler-rt\lib\asan\asan_poisoning.cpp(450): warning C4390: ';': empty controlled statement found; is this the intent? [4/56] Building CXX object projects\compiler-rt\lib\asan\CMakeFiles\RTAsan_dynamic.x86_64.dir\asan_poisoning.cpp.obj C:\git\llvm-project\compiler-rt\lib\asan\asan_poisoning.cpp(450): warning C4390: ';': empty controlled statement found; is this the intent? ```
1 parent 6f2358e commit 82694d9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler-rt/lib/asan/asan_poisoning.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,11 @@ void __sanitizer_annotate_contiguous_container(const void *beg_p,
446446
// https://github.com/google/sanitizers/issues/258.
447447
// if (d1 != d2)
448448
// DCHECK_EQ(*(u8*)MemToShadow(d1), old_mid - d1);
449-
if (a + granularity <= d1)
449+
//
450+
// NOTE: curly brackets for the "if" below to silence a MSVC warning.
451+
if (a + granularity <= d1) {
450452
DCHECK_EQ(*(u8 *)MemToShadow(a), 0);
453+
}
451454
// if (d2 + granularity <= c && c <= end)
452455
// DCHECK_EQ(*(u8 *)MemToShadow(c - granularity),
453456
// kAsanContiguousContainerOOBMagic);

0 commit comments

Comments
 (0)