llvm.org GIT mirror llvm / 03de2a6
[msan] Change va_start/va_copy shadow memset alignment to 8. This fixes va_start/va_copy of a va_list field which happens to not be laid out at a 16-byte boundary. Differential Revision: http://llvm-reviews.chandlerc.com/D276 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172128 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 6 years ago
2 changed file(s) with 15 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
17731773 // Unpoison the whole __va_list_tag.
17741774 // FIXME: magic ABI constants.
17751775 IRB.CreateMemSet(ShadowPtr, Constant::getNullValue(IRB.getInt8Ty()),
1776 /* size */24, /* alignment */16, false);
1776 /* size */24, /* alignment */8, false);
17771777 }
17781778
17791779 void visitVACopyInst(VACopyInst &I) {
17841784 // Unpoison the whole __va_list_tag.
17851785 // FIXME: magic ABI constants.
17861786 IRB.CreateMemSet(ShadowPtr, Constant::getNullValue(IRB.getInt8Ty()),
1787 /* size */ 24, /* alignment */ 16, false);
1787 /* size */24, /* alignment */8, false);
17881788 }
17891789
17901790 void finalizeInstrumentation() {
533533 ; CHECK: load <8 x i8*>*
534534 ; CHECK: store <8 x i64> {{.*}} @__msan_retval_tls
535535 ; CHECK: ret <8 x i8*>
536
537 ; Test handling of va_copy.
538
539 declare void @llvm.va_copy(i8*, i8*) nounwind
540
541 define void @VACopy(i8* %p1, i8* %p2) nounwind uwtable {
542 call void @llvm.va_copy(i8* %p1, i8* %p2) nounwind
543 ret void
544 }
545
546 ; CHECK: @VACopy
547 ; CHECK: call void @llvm.memset.p0i8.i64({{.*}}, i8 0, i64 24, i32 8, i1 false)
548 ; CHECK: ret void