[compiler-rt] r323755 - [XRay] [compiler-rt] stop writing garbage in naive log records
Martin Pelikan via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 05:25:25 PST 2018
Author: pelikan
Date: Tue Jan 30 05:25:25 2018
New Revision: 323755
URL: http://llvm.org/viewvc/llvm-project?rev=323755&view=rev
Log:
[XRay] [compiler-rt] stop writing garbage in naive log records
Summary:
Turns out sizeof(packed) isn't as strong as we'd hoped. This makes sure
that when we initialize the padding, all 12 bytes will be zero.
Reviewers: dberris, kpw, eizan
Subscribers: delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D42494
Modified:
compiler-rt/trunk/include/xray/xray_records.h
Modified: compiler-rt/trunk/include/xray/xray_records.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/xray/xray_records.h?rev=323755&r1=323754&r2=323755&view=diff
==============================================================================
--- compiler-rt/trunk/include/xray/xray_records.h (original)
+++ compiler-rt/trunk/include/xray/xray_records.h Tue Jan 30 05:25:25 2018
@@ -96,7 +96,7 @@ struct alignas(32) XRayRecord {
uint32_t TId = 0;
// Use some bytes in the end of the record for buffers.
- char Buffer[4] = {};
+ char Buffer[12] = {};
} __attribute__((packed));
static_assert(sizeof(XRayRecord) == 32, "XRayRecord != 32 bytes");
More information about the llvm-commits
mailing list