Skip to content

Commit 84dc97e

Browse files
authored
[MSan] Fix check overflow in a test case (llvm#150429)
Supplement to PR llvm#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.
1 parent 6546124 commit 84dc97e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/test/msan/msan_check_mem_is_initialized.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int main(void) {
1212
__msan_poison(p + 10, 2);
1313

1414
__msan_check_mem_is_initialized(p, 10);
15-
__msan_check_mem_is_initialized(p + 12, 30);
15+
__msan_check_mem_is_initialized(p + 12, 20);
1616
#ifdef POSITIVE
1717
__msan_check_mem_is_initialized(p + 5, 20);
1818
// CHECK: Uninitialized bytes in __msan_check_mem_is_initialized at offset 5 inside [0x{{.*}}, 20)

0 commit comments

Comments
 (0)