[compiler-rt] [MSan] Fix check overflow in a test case (PR #150429)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 24 07:37:31 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: Kunqiu Chen (Camsyn)
<details>
<summary>Changes</summary>
Supplement to PR #<!-- -->144073
Previously, _msan_check_mem_is_initialized.cpp_ initialized a 32-byte stack array, but checked the shadow for the offset range [12, 42), exceeding the stack array size.
MSan does not guarantee that the shadow corresponding to the overflow part is 0, so it is undefined to require the overflow part to be unpoisoned.
---
Full diff: https://github.com/llvm/llvm-project/pull/150429.diff
1 Files Affected:
- (modified) compiler-rt/test/msan/msan_check_mem_is_initialized.cpp (+1-1)
``````````diff
diff --git a/compiler-rt/test/msan/msan_check_mem_is_initialized.cpp b/compiler-rt/test/msan/msan_check_mem_is_initialized.cpp
index aaf5737ebe236..aab31893e01bc 100644
--- a/compiler-rt/test/msan/msan_check_mem_is_initialized.cpp
+++ b/compiler-rt/test/msan/msan_check_mem_is_initialized.cpp
@@ -12,7 +12,7 @@ int main(void) {
__msan_poison(p + 10, 2);
__msan_check_mem_is_initialized(p, 10);
- __msan_check_mem_is_initialized(p + 12, 30);
+ __msan_check_mem_is_initialized(p + 12, 20);
#ifdef POSITIVE
__msan_check_mem_is_initialized(p + 5, 20);
// CHECK: Uninitialized bytes in __msan_check_mem_is_initialized at offset 5 inside [0x{{.*}}, 20)
``````````
</details>
https://github.com/llvm/llvm-project/pull/150429
More information about the llvm-commits
mailing list