From 84087c90b38659ddbb2ec79f4484a93e3efa8f88 Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Tue, 12 Dec 2023 09:03:02 +0000 Subject: [PATCH] fixup aarch64 --- src/string_decoder.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/string_decoder.rs b/src/string_decoder.rs index d9bc9eb..4b219c4 100644 --- a/src/string_decoder.rs +++ b/src/string_decoder.rs @@ -78,6 +78,8 @@ fn decode_onebyone<'j, 't>( where 'j: 't, { + index += 1; + let start = index; let mut last_escape = start; let mut found_escape = false; @@ -98,7 +100,10 @@ where }; } b'\\' => { - found_escape = true; + if !found_escape { + tape.clear(); + found_escape = true; + } tape.extend_from_slice(&data[last_escape..index]); index += 1; if let Some(next_inner) = data.get(index) { @@ -142,6 +147,8 @@ fn decode_simd<'j, 't>( where 'j: 't, { + index += 1; + let start = index; let mut last_escape = start; let mut found_escape = false; @@ -213,7 +220,10 @@ where }; } b'\\' => { - found_escape = true; + if !found_escape { + tape.clear(); + found_escape = true; + } tape.extend_from_slice(&data[last_escape..index]); index += 1; if let Some(next_inner) = data.get(index) {