File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -881,9 +881,10 @@ class DwarfElfStream : public DwarfWriteStream {
881881 }
882882
883883 void u1 (uint8_t value) { stream_->WriteFixed (value); }
884- void u2 (uint16_t value) { stream_->WriteFixed (value); }
885- void u4 (uint32_t value) { stream_->WriteFixed (value); }
886- void u8 (uint64_t value) { stream_->WriteFixed (value); }
884+ // Can't use WriteFixed for these, as we may not be at aligned positions.
885+ void u2 (uint16_t value) { stream_->WriteBytes (&value, sizeof (value)); }
886+ void u4 (uint32_t value) { stream_->WriteBytes (&value, sizeof (value)); }
887+ void u8 (uint64_t value) { stream_->WriteBytes (&value, sizeof (value)); }
887888 void string (const char * cstr) { // NOLINT
888889 stream_->WriteBytes (reinterpret_cast <const uint8_t *>(cstr),
889890 strlen (cstr) + 1 );
You can’t perform that action at this time.
0 commit comments