diff --git a/compiler-rt/lib/memprof/memprof_rawprofile.cpp b/compiler-rt/lib/memprof/memprof_rawprofile.cpp --- a/compiler-rt/lib/memprof/memprof_rawprofile.cpp +++ b/compiler-rt/lib/memprof/memprof_rawprofile.cpp @@ -20,7 +20,7 @@ using Header = ::llvm::memprof::Header; namespace { -template char *WriteBytes(T Pod, char *&Buffer) { +template char *WriteBytes(const T &Pod, char *Buffer) { *(T *)Buffer = Pod; return Buffer + sizeof(T); }