diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/gimli/src/read | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gimli/src/read')
-rw-r--r-- | vendor/gimli/src/read/cfi.rs | 226 | ||||
-rw-r--r-- | vendor/gimli/src/read/endian_slice.rs | 33 | ||||
-rw-r--r-- | vendor/gimli/src/read/line.rs | 2 | ||||
-rw-r--r-- | vendor/gimli/src/read/mod.rs | 6 | ||||
-rw-r--r-- | vendor/gimli/src/read/op.rs | 10 | ||||
-rw-r--r-- | vendor/gimli/src/read/reader.rs | 2 | ||||
-rw-r--r-- | vendor/gimli/src/read/unit.rs | 2 | ||||
-rw-r--r-- | vendor/gimli/src/read/value.rs | 6 |
8 files changed, 203 insertions, 84 deletions
diff --git a/vendor/gimli/src/read/cfi.rs b/vendor/gimli/src/read/cfi.rs index 5e9befac1..6ac019f10 100644 --- a/vendor/gimli/src/read/cfi.rs +++ b/vendor/gimli/src/read/cfi.rs @@ -8,7 +8,9 @@ use core::mem; use core::num::Wrapping; use super::util::{ArrayLike, ArrayVec}; -use crate::common::{DebugFrameOffset, EhFrameOffset, Encoding, Format, Register, SectionId}; +use crate::common::{ + DebugFrameOffset, EhFrameOffset, Encoding, Format, Register, SectionId, Vendor, +}; use crate::constants::{self, DwEhPe}; use crate::endianity::Endianity; use crate::read::{ @@ -34,6 +36,7 @@ pub struct DebugFrame<R: Reader> { section: R, address_size: u8, segment_size: u8, + vendor: Vendor, } impl<R: Reader> DebugFrame<R> { @@ -52,6 +55,13 @@ impl<R: Reader> DebugFrame<R> { pub fn set_segment_size(&mut self, segment_size: u8) { self.segment_size = segment_size } + + /// Set the vendor extensions to use. + /// + /// This defaults to `Vendor::Default`. + pub fn set_vendor(&mut self, vendor: Vendor) { + self.vendor = vendor; + } } impl<'input, Endian> DebugFrame<EndianSlice<'input, Endian>> @@ -95,6 +105,7 @@ impl<R: Reader> From<R> for DebugFrame<R> { section, address_size: mem::size_of::<usize>() as u8, segment_size: 0, + vendor: Vendor::Default, } } } @@ -158,11 +169,7 @@ impl<R: Reader> EhFrameHdr<R> { if fde_count_enc == constants::DW_EH_PE_omit || table_enc == constants::DW_EH_PE_omit { fde_count = 0 } else { - let ptr = parse_encoded_pointer(fde_count_enc, ¶meters, &mut reader)?; - fde_count = match ptr { - Pointer::Direct(c) => c, - Pointer::Indirect(_) => return Err(Error::UnsupportedPointerEncoding), - } + fde_count = parse_encoded_pointer(fde_count_enc, ¶meters, &mut reader)?.direct()?; } Ok(ParsedEhFrameHdr { @@ -348,11 +355,8 @@ impl<'a, R: Reader + 'a> EhHdrTable<'a, R> { let head = reader.split(R::Offset::from_u64((len / 2) * row_size)?)?; let tail = reader.clone(); - let pivot = parse_encoded_pointer(self.hdr.table_enc, ¶meters, &mut reader)?; - let pivot = match pivot { - Pointer::Direct(x) => x, - Pointer::Indirect(_) => return Err(Error::UnsupportedPointerEncoding), - }; + let pivot = + parse_encoded_pointer(self.hdr.table_enc, ¶meters, &mut reader)?.direct()?; match pivot.cmp(&address) { Ordering::Equal => { @@ -379,15 +383,8 @@ impl<'a, R: Reader + 'a> EhHdrTable<'a, R> { /// /// This does not support indirect pointers. pub fn pointer_to_offset(&self, ptr: Pointer) -> Result<EhFrameOffset<R::Offset>> { - let ptr = match ptr { - Pointer::Direct(x) => x, - _ => return Err(Error::UnsupportedPointerEncoding), - }; - - let eh_frame_ptr = match self.hdr.eh_frame_ptr() { - Pointer::Direct(x) => x, - _ => return Err(Error::UnsupportedPointerEncoding), - }; + let ptr = ptr.direct()?; + let eh_frame_ptr = self.hdr.eh_frame_ptr().direct()?; // Calculate the offset in the EhFrame section R::Offset::from_u64(ptr - eh_frame_ptr).map(EhFrameOffset) @@ -496,6 +493,7 @@ impl<'a, R: Reader + 'a> EhHdrTable<'a, R> { pub struct EhFrame<R: Reader> { section: R, address_size: u8, + vendor: Vendor, } impl<R: Reader> EhFrame<R> { @@ -505,6 +503,13 @@ impl<R: Reader> EhFrame<R> { pub fn set_address_size(&mut self, address_size: u8) { self.address_size = address_size } + + /// Set the vendor extensions to use. + /// + /// This defaults to `Vendor::Default`. + pub fn set_vendor(&mut self, vendor: Vendor) { + self.vendor = vendor; + } } impl<'input, Endian> EhFrame<EndianSlice<'input, Endian>> @@ -547,6 +552,7 @@ impl<R: Reader> From<R> for EhFrame<R> { EhFrame { section, address_size: mem::size_of::<usize>() as u8, + vendor: Vendor::Default, } } } @@ -627,6 +633,9 @@ pub trait _UnwindSectionPrivate<R: Reader> { /// The segment size to use if `has_address_and_segment_sizes` returns false. fn segment_size(&self) -> u8; + + /// The vendor extensions to use. + fn vendor(&self) -> Vendor; } /// A section holding unwind information: either `.debug_frame` or @@ -822,6 +831,10 @@ impl<R: Reader> _UnwindSectionPrivate<R> for DebugFrame<R> { fn segment_size(&self) -> u8 { self.segment_size } + + fn vendor(&self) -> Vendor { + self.vendor + } } impl<R: Reader> UnwindSection<R> for DebugFrame<R> { @@ -862,6 +875,10 @@ impl<R: Reader> _UnwindSectionPrivate<R> for EhFrame<R> { fn segment_size(&self) -> u8 { 0 } + + fn vendor(&self) -> Vendor { + self.vendor + } } impl<R: Reader> UnwindSection<R> for EhFrame<R> { @@ -1435,6 +1452,7 @@ impl<R: Reader> CommonInformationEntry<R> { address_size: self.address_size, section: section.section(), }, + vendor: section.vendor(), } } @@ -1683,12 +1701,12 @@ impl<R: Reader> FrameDescriptionEntry<R> { let initial_address = parse_encoded_pointer(encoding, parameters, input)?; // Ignore indirection. - let initial_address = initial_address.into(); + let initial_address = initial_address.pointer(); // Address ranges cannot be relative to anything, so just grab the // data format bits from the encoding. let address_range = parse_encoded_pointer(encoding.format(), parameters, input)?; - Ok((initial_address, address_range.into())) + Ok((initial_address, address_range.pointer())) } else { let initial_address = input.read_address(cie.address_size)?; let address_range = input.read_address(cie.address_size)?; @@ -1778,6 +1796,7 @@ impl<R: Reader> FrameDescriptionEntry<R> { address_size: self.cie.address_size, section: section.section(), }, + vendor: section.vendor(), } } @@ -2414,6 +2433,18 @@ impl<'a, 'ctx, R: Reader, A: UnwindContextStorage<R>> UnwindTable<'a, 'ctx, R, A self.ctx.row_mut().saved_args_size = size; } + // AArch64 extension. + NegateRaState => { + let register = crate::AArch64::RA_SIGN_STATE; + let value = match self.ctx.row().register(register) { + RegisterRule::Undefined => 0, + RegisterRule::Constant(value) => value, + _ => return Err(Error::CfiInstructionInInvalidContext), + }; + self.ctx + .set_register_rule(register, RegisterRule::Constant(value ^ 1))?; + } + // No operation. Nop => {} }; @@ -2783,6 +2814,7 @@ impl<R: Reader> CfaRule<R> { /// has been saved and the rule to find the value for the register in the /// previous frame." #[derive(Clone, Debug, PartialEq, Eq)] +#[non_exhaustive] pub enum RegisterRule<R: Reader> { /// > A register that has this rule has no recoverable value in the previous /// > frame. (By convention, it is not preserved by a callee.) @@ -2815,6 +2847,9 @@ pub enum RegisterRule<R: Reader> { /// "The rule is defined externally to this specification by the augmenter." Architectural, + + /// This is a pseudo-register with a constant value. + Constant(u64), } impl<R: Reader> RegisterRule<R> { @@ -2825,6 +2860,7 @@ impl<R: Reader> RegisterRule<R> { /// A parsed call frame instruction. #[derive(Clone, Debug, PartialEq, Eq)] +#[non_exhaustive] pub enum CallFrameInstruction<R: Reader> { // 6.4.2.1 Row Creation Methods /// > 1. DW_CFA_set_loc @@ -3102,6 +3138,17 @@ pub enum CallFrameInstruction<R: Reader> { size: u64, }, + /// > DW_CFA_AARCH64_negate_ra_state + /// > + /// > AArch64 Extension + /// > + /// > The DW_CFA_AARCH64_negate_ra_state operation negates bit[0] of the + /// > RA_SIGN_STATE pseudo-register. It does not take any operands. The + /// > DW_CFA_AARCH64_negate_ra_state must not be mixed with other DWARF Register + /// > Rule Instructions on the RA_SIGN_STATE pseudo-register in one Common + /// > Information Entry (CIE) and Frame Descriptor Entry (FDE) program sequence. + NegateRaState, + // 6.4.2.5 Padding Instruction /// > 1. DW_CFA_nop /// > @@ -3118,6 +3165,7 @@ impl<R: Reader> CallFrameInstruction<R> { input: &mut R, address_encoding: Option<DwEhPe>, parameters: &PointerEncodingParameters<R>, + vendor: Vendor, ) -> Result<CallFrameInstruction<R>> { let instruction = input.read_u8()?; let high_bits = instruction & CFI_INSTRUCTION_HIGH_BITS_MASK; @@ -3151,10 +3199,7 @@ impl<R: Reader> CallFrameInstruction<R> { constants::DW_CFA_set_loc => { let address = if let Some(encoding) = address_encoding { - match parse_encoded_pointer(encoding, parameters, input)? { - Pointer::Direct(x) => x, - _ => return Err(Error::UnsupportedPointerEncoding), - } + parse_encoded_pointer(encoding, parameters, input)?.direct()? } else { input.read_address(parameters.address_size)? }; @@ -3309,6 +3354,10 @@ impl<R: Reader> CallFrameInstruction<R> { Ok(CallFrameInstruction::ArgsSize { size }) } + constants::DW_CFA_AARCH64_negate_ra_state if vendor == Vendor::AArch64 => { + Ok(CallFrameInstruction::NegateRaState) + } + otherwise => Err(Error::UnknownCallFrameInstruction(otherwise)), } } @@ -3323,6 +3372,7 @@ pub struct CallFrameInstructionIter<'a, R: Reader> { input: R, address_encoding: Option<constants::DwEhPe>, parameters: PointerEncodingParameters<'a, R>, + vendor: Vendor, } impl<'a, R: Reader> CallFrameInstructionIter<'a, R> { @@ -3332,8 +3382,12 @@ impl<'a, R: Reader> CallFrameInstructionIter<'a, R> { return Ok(None); } - match CallFrameInstruction::parse(&mut self.input, self.address_encoding, &self.parameters) - { + match CallFrameInstruction::parse( + &mut self.input, + self.address_encoding, + &self.parameters, + self.vendor, + ) { Ok(instruction) => Ok(Some(instruction)), Err(e) => { self.input.empty(); @@ -3389,15 +3443,6 @@ impl Default for Pointer { } } -impl From<Pointer> for u64 { - #[inline] - fn from(p: Pointer) -> u64 { - match p { - Pointer::Direct(p) | Pointer::Indirect(p) => p, - } - } -} - impl Pointer { #[inline] fn new(encoding: constants::DwEhPe, address: u64) -> Pointer { @@ -3407,6 +3452,23 @@ impl Pointer { Pointer::Direct(address) } } + + /// Return the direct pointer value. + #[inline] + pub fn direct(self) -> Result<u64> { + match self { + Pointer::Direct(p) => Ok(p), + Pointer::Indirect(_) => Err(Error::UnsupportedPointerEncoding), + } + } + + /// Return the pointer value, discarding indirectness information. + #[inline] + pub fn pointer(self) -> u64 { + match self { + Pointer::Direct(p) | Pointer::Indirect(p) => p, + } + } } #[derive(Clone, Debug)] @@ -3637,7 +3699,7 @@ mod tests { .uleb(cie.code_alignment_factor) .sleb(cie.data_alignment_factor) .uleb(cie.return_address_register.0.into()) - .append_bytes(cie.initial_instructions.into()) + .append_bytes(cie.initial_instructions.slice()) .mark(&end); cie.length = (&end - &start) as usize; @@ -3714,11 +3776,11 @@ mod tests { let section = section.uleb(u64::from(fde.cie.address_size)); match fde.cie.address_size { 4 => section.D32({ - let x: u64 = lsda.into(); + let x: u64 = lsda.pointer(); x as u32 }), 8 => section.D64({ - let x: u64 = lsda.into(); + let x: u64 = lsda.pointer(); x }), x => panic!("Unsupported address size: {}", x), @@ -3732,7 +3794,7 @@ mod tests { section }; - let section = section.append_bytes(fde.instructions.into()).mark(&end); + let section = section.append_bytes(fde.instructions.slice()).mark(&end); fde.length = (&end - &start) as usize; length.set_const(fde.length as u64); @@ -4445,7 +4507,7 @@ mod tests { address_size, section: &R::default(), }; - CallFrameInstruction::parse(input, None, parameters) + CallFrameInstruction::parse(input, None, parameters, Vendor::Default) } #[test] @@ -4558,7 +4620,12 @@ mod tests { section: &EndianSlice::new(&[], LittleEndian), }; assert_eq!( - CallFrameInstruction::parse(input, Some(constants::DW_EH_PE_textrel), parameters), + CallFrameInstruction::parse( + input, + Some(constants::DW_EH_PE_textrel), + parameters, + Vendor::Default + ), Ok(CallFrameInstruction::SetLoc { address: expected_addr, }) @@ -5018,6 +5085,27 @@ mod tests { } #[test] + fn test_parse_cfi_instruction_negate_ra_state() { + let expected_rest = [1, 2, 3, 4]; + let section = Section::with_endian(Endian::Little) + .D8(constants::DW_CFA_AARCH64_negate_ra_state.0) + .append_bytes(&expected_rest); + let contents = section.get_contents().unwrap(); + let input = &mut EndianSlice::new(&contents, LittleEndian); + let parameters = &PointerEncodingParameters { + bases: &SectionBaseAddresses::default(), + func_base: None, + address_size: 8, + section: &EndianSlice::default(), + }; + assert_eq!( + CallFrameInstruction::parse(input, None, parameters, Vendor::AArch64), + Ok(CallFrameInstruction::NegateRaState) + ); + assert_eq!(*input, EndianSlice::new(&expected_rest, LittleEndian)); + } + + #[test] fn test_parse_cfi_instruction_unknown_instruction() { let expected_rest = [1, 2, 3, 4]; let unknown_instr = constants::DwCfa(0b0011_1111); @@ -5065,6 +5153,7 @@ mod tests { input, address_encoding: None, parameters, + vendor: Vendor::Default, }; assert_eq!( @@ -5102,6 +5191,7 @@ mod tests { input, address_encoding: None, parameters, + vendor: Vendor::Default, }; assert_eq!( @@ -5580,6 +5670,55 @@ mod tests { } #[test] + fn test_eval_negate_ra_state() { + let cie = make_test_cie(); + let ctx = UnwindContext::new(); + let mut expected = ctx.clone(); + expected + .set_register_rule(crate::AArch64::RA_SIGN_STATE, RegisterRule::Constant(1)) + .unwrap(); + let instructions = [(Ok(false), CallFrameInstruction::NegateRaState)]; + assert_eval(ctx, expected, cie, None, instructions); + + let cie = make_test_cie(); + let ctx = UnwindContext::new(); + let mut expected = ctx.clone(); + expected + .set_register_rule(crate::AArch64::RA_SIGN_STATE, RegisterRule::Constant(0)) + .unwrap(); + let instructions = [ + (Ok(false), CallFrameInstruction::NegateRaState), + (Ok(false), CallFrameInstruction::NegateRaState), + ]; + assert_eval(ctx, expected, cie, None, instructions); + + // NegateRaState can't be used with other instructions. + let cie = make_test_cie(); + let ctx = UnwindContext::new(); + let mut expected = ctx.clone(); + expected + .set_register_rule( + crate::AArch64::RA_SIGN_STATE, + RegisterRule::Offset(cie.data_alignment_factor as i64), + ) + .unwrap(); + let instructions = [ + ( + Ok(false), + CallFrameInstruction::Offset { + register: crate::AArch64::RA_SIGN_STATE, + factored_offset: 1, + }, + ), + ( + Err(Error::CfiInstructionInInvalidContext), + CallFrameInstruction::NegateRaState, + ), + ]; + assert_eval(ctx, expected, cie, None, instructions); + } + + #[test] fn test_eval_nop() { let cie = make_test_cie(); let ctx = UnwindContext::new(); @@ -6262,7 +6401,6 @@ mod tests { section.start().set_const(0); let section = section.get_contents().unwrap(); - let section = EndianSlice::new(§ion, LittleEndian); let eh_frame = kind.section(§ion); // Setup eh_frame_hdr diff --git a/vendor/gimli/src/read/endian_slice.rs b/vendor/gimli/src/read/endian_slice.rs index d0fd67c0b..fbf5cbb79 100644 --- a/vendor/gimli/src/read/endian_slice.rs +++ b/vendor/gimli/src/read/endian_slice.rs @@ -4,7 +4,7 @@ use alloc::borrow::Cow; #[cfg(feature = "read")] use alloc::string::String; -use core::ops::{Deref, Index, Range, RangeFrom, RangeTo}; +use core::ops::{Deref, Range, RangeFrom, RangeTo}; use core::str; use crate::endianity::Endianity; @@ -57,7 +57,7 @@ where (self.range_to(..idx), self.range_from(idx..)) } - /// Find the first occurence of a byte in the slice, and return its index. + /// Find the first occurrence of a byte in the slice, and return its index. #[inline] pub fn find(&self, byte: u8) -> Option<usize> { self.slice.iter().position(|ch| *ch == byte) @@ -167,26 +167,6 @@ where } } -impl<'input, Endian> Index<usize> for EndianSlice<'input, Endian> -where - Endian: Endianity, -{ - type Output = u8; - fn index(&self, idx: usize) -> &Self::Output { - &self.slice[idx] - } -} - -impl<'input, Endian> Index<RangeFrom<usize>> for EndianSlice<'input, Endian> -where - Endian: Endianity, -{ - type Output = [u8]; - fn index(&self, idx: RangeFrom<usize>) -> &Self::Output { - &self.slice[idx] - } -} - impl<'input, Endian> Deref for EndianSlice<'input, Endian> where Endian: Endianity, @@ -197,15 +177,6 @@ where } } -impl<'input, Endian> From<EndianSlice<'input, Endian>> for &'input [u8] -where - Endian: Endianity, -{ - fn from(endian_slice: EndianSlice<'input, Endian>) -> &'input [u8] { - endian_slice.slice - } -} - impl<'input, Endian> Reader for EndianSlice<'input, Endian> where Endian: Endianity, diff --git a/vendor/gimli/src/read/line.rs b/vendor/gimli/src/read/line.rs index 65400a99e..47eae92e6 100644 --- a/vendor/gimli/src/read/line.rs +++ b/vendor/gimli/src/read/line.rs @@ -2327,7 +2327,7 @@ mod tests { fn test_parse_unknown_standard_opcode_many_args() { let input = [OPCODE_BASE, 1, 2, 3]; let input = EndianSlice::new(&input, LittleEndian); - let args = EndianSlice::new(&input[1..], LittleEndian); + let args = input.range_from(1..); let mut standard_opcode_lengths = Vec::new(); let mut header = make_test_header(input); standard_opcode_lengths.extend(header.standard_opcode_lengths.slice()); diff --git a/vendor/gimli/src/read/mod.rs b/vendor/gimli/src/read/mod.rs index 82b79502d..22a8e9fbe 100644 --- a/vendor/gimli/src/read/mod.rs +++ b/vendor/gimli/src/read/mod.rs @@ -41,10 +41,10 @@ //! //! Full example programs: //! -//! * [A simple parser](https://github.com/gimli-rs/gimli/blob/master/examples/simple.rs) +//! * [A simple parser](https://github.com/gimli-rs/gimli/blob/master/crates/examples/src/bin/simple.rs) //! //! * [A `dwarfdump` -//! clone](https://github.com/gimli-rs/gimli/blob/master/examples/dwarfdump.rs) +//! clone](https://github.com/gimli-rs/gimli/blob/master/crates/examples/src/bin/dwarfdump.rs) //! //! * [An `addr2line` clone](https://github.com/gimli-rs/addr2line) //! @@ -55,7 +55,7 @@ //! compilers used to create each compilation unit within a shared library or //! executable (via `DW_AT_producer`) //! -//! * [`dwarf-validate`](https://github.com/gimli-rs/gimli/blob/master/examples/dwarf-validate.rs), +//! * [`dwarf-validate`](https://github.com/gimli-rs/gimli/blob/master/crates/examples/src/bin/dwarf-validate.rs), //! a program to validate the integrity of some DWARF and its references //! between sections and compilation units. //! diff --git a/vendor/gimli/src/read/op.rs b/vendor/gimli/src/read/op.rs index 670d1ad21..0b6a71b48 100644 --- a/vendor/gimli/src/read/op.rs +++ b/vendor/gimli/src/read/op.rs @@ -985,6 +985,16 @@ impl<R: Reader> OperationIter<R> { } } +#[cfg(feature = "fallible-iterator")] +impl<R: Reader> fallible_iterator::FallibleIterator for OperationIter<R> { + type Item = Operation<R>; + type Error = Error; + + fn next(&mut self) -> ::core::result::Result<Option<Self::Item>, Self::Error> { + OperationIter::next(self) + } +} + /// Specification of what storage should be used for [`Evaluation`]. /// #[cfg_attr( diff --git a/vendor/gimli/src/read/reader.rs b/vendor/gimli/src/read/reader.rs index 1bb748bb8..e7dd4772c 100644 --- a/vendor/gimli/src/read/reader.rs +++ b/vendor/gimli/src/read/reader.rs @@ -245,7 +245,7 @@ pub trait Reader: Debug + Clone { /// it is associated with this reader. fn lookup_offset_id(&self, id: ReaderOffsetId) -> Option<Self::Offset>; - /// Find the index of the first occurence of the given byte. + /// Find the index of the first occurrence of the given byte. /// The offset of the reader is not changed. fn find(&self, byte: u8) -> Result<Self::Offset>; diff --git a/vendor/gimli/src/read/unit.rs b/vendor/gimli/src/read/unit.rs index 672435330..d799f0f07 100644 --- a/vendor/gimli/src/read/unit.rs +++ b/vendor/gimli/src/read/unit.rs @@ -3295,7 +3295,7 @@ mod tests { } }; - let section = section.append_bytes(unit.entries_buf.into()).mark(&end); + let section = section.append_bytes(unit.entries_buf.slice()).mark(&end); unit.unit_length = (&end - &start) as usize; length.set_const(unit.unit_length as u64); diff --git a/vendor/gimli/src/read/value.rs b/vendor/gimli/src/read/value.rs index 6f43ebb26..77b08eda5 100644 --- a/vendor/gimli/src/read/value.rs +++ b/vendor/gimli/src/read/value.rs @@ -367,7 +367,7 @@ impl Value { Value::I64(value) => Value::I64(value.wrapping_neg()), Value::F32(value) => Value::F32(-value), Value::F64(value) => Value::F64(-value), - // It's unclear if these should implicity convert to a signed value. + // It's unclear if these should implicitly convert to a signed value. // For now, we don't support them. Value::U8(_) | Value::U16(_) | Value::U32(_) | Value::U64(_) => { return Err(Error::UnsupportedTypeOperation); @@ -664,7 +664,7 @@ impl Value { Value::U16(v1) => Value::U16(if v2 >= 16 { 0 } else { v1 >> v2 }), Value::U32(v1) => Value::U32(if v2 >= 32 { 0 } else { v1 >> v2 }), Value::U64(v1) => Value::U64(if v2 >= 64 { 0 } else { v1 >> v2 }), - // It's unclear if signed values should implicity convert to an unsigned value. + // It's unclear if signed values should implicitly convert to an unsigned value. // For now, we don't support them. Value::I8(_) | Value::I16(_) | Value::I32(_) | Value::I64(_) => { return Err(Error::UnsupportedTypeOperation); @@ -737,7 +737,7 @@ impl Value { } else { v1 >> v2 }), - // It's unclear if unsigned values should implicity convert to a signed value. + // It's unclear if unsigned values should implicitly convert to a signed value. // For now, we don't support them. Value::U8(_) | Value::U16(_) | Value::U32(_) | Value::U64(_) => { return Err(Error::UnsupportedTypeOperation); |