diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
commit | 4f9fe856a25ab29345b90e7725509e9ee38a37be (patch) | |
tree | e4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /vendor/gimli/src/write/op.rs | |
parent | Adding upstream version 1.68.2+dfsg1. (diff) | |
download | rustc-5cd5bd4daf55da04d2c8e7c06c3067a027cfbfc2.tar.xz rustc-5cd5bd4daf55da04d2c8e7c06c3067a027cfbfc2.zip |
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/gimli/src/write/op.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/vendor/gimli/src/write/op.rs b/vendor/gimli/src/write/op.rs index c70eec2dd..287083b3e 100644 --- a/vendor/gimli/src/write/op.rs +++ b/vendor/gimli/src/write/op.rs @@ -279,12 +279,8 @@ impl Expression { } offsets.push(offset); for (operation, offset) in self.operations.iter().zip(offsets.iter().copied()) { - let refs = match refs { - Some(ref mut refs) => Some(&mut **refs), - None => None, - }; debug_assert_eq!(w.len(), offset); - operation.write(w, refs, encoding, unit_offsets, &offsets)?; + operation.write(w, refs.as_deref_mut(), encoding, unit_offsets, &offsets)?; } Ok(()) } @@ -630,7 +626,7 @@ impl Operation { } w.write_uleb128(entry_offset(base)?)?; w.write_udata(value.len() as u64, 1)?; - w.write(&value)?; + w.write(value)?; } Operation::FrameOffset(offset) => { w.write_u8(constants::DW_OP_fbreg.0)?; @@ -770,7 +766,7 @@ impl Operation { Operation::ImplicitValue(ref data) => { w.write_u8(constants::DW_OP_implicit_value.0)?; w.write_uleb128(data.len() as u64)?; - w.write(&data)?; + w.write(data)?; } Operation::ImplicitPointer { entry, byte_offset } => { if encoding.version >= 5 { @@ -872,7 +868,7 @@ pub(crate) mod convert { let mut offsets = Vec::new(); let mut offset = 0; let mut from_operations = from_expression.clone().operations(encoding); - while let Some(_) = from_operations.next()? { + while from_operations.next()?.is_some() { offsets.push(offset); offset = from_operations.offset_from(&from_expression); } @@ -1071,6 +1067,7 @@ mod tests { }; use crate::LittleEndian; use std::collections::HashMap; + use std::sync::Arc; #[test] fn test_operation() { @@ -1578,7 +1575,7 @@ mod tests { DebugInfoOffset(0).into(), read::EndianSlice::new(&[], LittleEndian), ), - abbreviations: read::Abbreviations::default(), + abbreviations: Arc::new(read::Abbreviations::default()), name: None, comp_dir: None, low_pc: 0, |