1
Fork 0

Apply suggestions from code review

Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
This commit is contained in:
Ben Kimock 2023-12-10 23:04:50 -05:00
parent b94cfefc86
commit 79bdd24d6e
3 changed files with 9 additions and 10 deletions

View file

@ -162,7 +162,7 @@ pub(super) fn get_metadata_xcoff<'a>(path: &Path, data: &'a [u8]) -> Result<&'a
return Err(format!("Invalid metadata symbol offset: {offset}"));
}
// The offset specifies the location of rustc metadata in the comment section.
// The metadata is preceded by a 4-byte length field.
// The metadata is preceded by a 8-byte length field.
let len = u64::from_le_bytes(info_data[(offset - 8)..offset].try_into().unwrap()) as usize;
if offset + len > (info_data.len() as usize) {
return Err(format!(