Skip to content

Commit 13ea584

Browse files
committed
Mark unsafe blocks for SIMD parsing functions in Deserializer
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
1 parent 0f533c3 commit 13ea584

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/lib.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ impl<'de> Deserializer<'de> {
559559
idx: usize,
560560
) -> Result<&'de str> {
561561
let input: SillyWrapper<'de> = SillyWrapper::from(input);
562-
impls::avx2::parse_str(input, data, buffer, idx)
562+
unsafe { impls::avx2::parse_str(input, data, buffer, idx) }
563563
}
564564

565565
#[cfg_attr(not(feature = "no-inline"), inline)]
@@ -576,7 +576,7 @@ impl<'de> Deserializer<'de> {
576576
idx: usize,
577577
) -> Result<&'de str> {
578578
let input: SillyWrapper<'de> = SillyWrapper::from(input);
579-
impls::sse42::parse_str(input, data, buffer, idx)
579+
unsafe { impls::sse42::parse_str(input, data, buffer, idx) }
580580
}
581581

582582
#[cfg_attr(not(feature = "no-inline"), inline)]
@@ -685,7 +685,9 @@ impl Deserializer<'_> {
685685
input: &[u8],
686686
structural_indexes: &mut Vec<u32>,
687687
) -> std::result::Result<(), ErrorType> {
688-
Self::_find_structural_bits::<impls::portable::SimdInput>(input, structural_indexes)
688+
unsafe {
689+
Self::_find_structural_bits::<impls::portable::SimdInput>(input, structural_indexes)
690+
}
689691
}
690692

691693
#[cfg(all(
@@ -698,7 +700,7 @@ impl Deserializer<'_> {
698700
input: &[u8],
699701
structural_indexes: &mut Vec<u32>,
700702
) -> std::result::Result<(), ErrorType> {
701-
Self::_find_structural_bits::<impls::avx2::SimdInput>(input, structural_indexes)
703+
unsafe { Self::_find_structural_bits::<impls::avx2::SimdInput>(input, structural_indexes) }
702704
}
703705

704706
#[cfg(all(
@@ -712,7 +714,7 @@ impl Deserializer<'_> {
712714
input: &[u8],
713715
structural_indexes: &mut Vec<u32>,
714716
) -> std::result::Result<(), ErrorType> {
715-
Self::_find_structural_bits::<impls::sse42::SimdInput>(input, structural_indexes)
717+
unsafe { Self::_find_structural_bits::<impls::sse42::SimdInput>(input, structural_indexes) }
716718
}
717719

718720
#[cfg(all(target_arch = "aarch64", not(feature = "portable")))]
@@ -730,7 +732,9 @@ impl Deserializer<'_> {
730732
input: &[u8],
731733
structural_indexes: &mut Vec<u32>,
732734
) -> std::result::Result<(), ErrorType> {
733-
Self::_find_structural_bits::<impls::simd128::SimdInput>(input, structural_indexes)
735+
unsafe {
736+
Self::_find_structural_bits::<impls::simd128::SimdInput>(input, structural_indexes)
737+
}
734738
}
735739
}
736740

0 commit comments

Comments
 (0)