Skip to content

Commit

Permalink
sqf: fix serilizing empty code (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror authored Sep 2, 2024
1 parent 721b008 commit 5100597
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/sqf/src/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ impl Statements {
.expect("first statement not in mapping");
let offset = start.processed_start().offset() as u32;
let source = processed.extract(self.span.clone());
let length = source.len() as u32;
let length = if self.content.is_empty() {
0
} else {
source.len() as u32
};
CodePointer::Source { offset, length }
};
Ok(Instructions {
Expand Down

0 comments on commit 5100597

Please sign in to comment.