[PATCH] D42494: [XRay] [compiler-rt] stop writing garbage in naive log records

Martin Pelikán via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 09:46:53 PST 2018


pelikan created this revision.
pelikan added reviewers: dberris, kpw, eizan.
Herald added subscribers: Sanitizers, delcypher.

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.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D42494

Files:
  include/xray/xray_records.h


Index: include/xray/xray_records.h
===================================================================
--- include/xray/xray_records.h
+++ include/xray/xray_records.h
@@ -96,7 +96,7 @@
   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");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42494.131300.patch
Type: text/x-patch
Size: 414 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180124/cd921e24/attachment.bin>


More information about the llvm-commits mailing list