diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp index a89958560c37..0581c2e056ad 100644 --- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp +++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp @@ -884,9 +884,11 @@ struct MappingTraits { virtual ContentPermissions permissions() const { return _permissions; } virtual bool isThumb() const { return false; } virtual bool isAlias() const { return false; } - ArrayRef rawContent() const { - return ArrayRef((uint8_t*)&_content.operator[](0), - _content.size()); } + ArrayRef rawContent() const { + return ArrayRef( + reinterpret_cast(_content.data()), _content.size()); + } + virtual uint64_t ordinal() const { return 0; } reference_iterator begin() const {