From cef857723599c86f1b2ac2a250050f4791ef15ab Mon Sep 17 00:00:00 2001 From: "Victor M. Alvarez" Date: Tue, 12 Sep 2023 10:00:04 +0200 Subject: [PATCH] fix: propagate error returned by `emit_clone` --- yara-x/src/re/thompson/compiler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yara-x/src/re/thompson/compiler.rs b/yara-x/src/re/thompson/compiler.rs index dcbd37cf0..0c3fae468 100644 --- a/yara-x/src/re/thompson/compiler.rs +++ b/yara-x/src/re/thompson/compiler.rs @@ -686,7 +686,7 @@ impl Compiler { // The first copy of `e` has already been emitted while // visiting the child nodes. Make min - 1 clones of `e`. for _ in 0..min.saturating_sub(1) { - self.emit_clone(start, end); + self.emit_clone(start, end)?; } // If min == 0 the first split and `e` are already emitted (the @@ -701,7 +701,7 @@ impl Compiler { Instr::SPLIT_B }); self.bookmarks.push(split); - self.emit_clone(start, end); + self.emit_clone(start, end)?; } if min > 1 {