From 27504814656fe678bbbba47ff2032729f197a44f Mon Sep 17 00:00:00 2001 From: BrettMayson Date: Wed, 7 Aug 2024 17:40:32 -0600 Subject: [PATCH] sqf: fix compiling spans of 0 length --- libs/workspace/src/reporting/processed.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/workspace/src/reporting/processed.rs b/libs/workspace/src/reporting/processed.rs index 05474b34..523a694a 100644 --- a/libs/workspace/src/reporting/processed.rs +++ b/libs/workspace/src/reporting/processed.rs @@ -270,6 +270,9 @@ impl Processed { #[must_use] /// Return a string with the source from the span pub fn extract(&self, span: Range) -> Arc { + if span.start + 1 == span.end { + return Arc::from(""); + } let mut real_start = 0; let mut real_end = 0; self.output.char_indices().for_each(|(p, c)| {