From 2c837b9c1ee0761a0b6d2d4b65f43ff6a54f4a23 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 18 Aug 2025 07:53:04 +0200 Subject: Reset literal mode before left arm of an operation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On an arithmetical/logical operation, the literal mode needed to be reset before evaluating the left arm since the previous evaluation of the node could have altered it. Signed-off-by: Miquel Sabaté Solà --- lib/xixanta/src/assembler.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/xixanta') diff --git a/lib/xixanta/src/assembler.rs b/lib/xixanta/src/assembler.rs index 26d5396..40d2438 100644 --- a/lib/xixanta/src/assembler.rs +++ b/lib/xixanta/src/assembler.rs @@ -900,6 +900,11 @@ impl<'a> Assembler<'a> { let mut right = self.evaluate_node(node.right.as_ref().unwrap())?; let rval = right.value(); + // Some operations need to evaluate a "left" node, and the literal mode + // might have been changed by the previous evaluation of the "right" + // node. Hence, reset it here to avoid problems. + self.literal_mode = None; + let res: isize = match operation_type { OperationType::UnaryPositive => { right.negative = false; -- cgit v1.2.3