From 3e769e9c48fb3f381407a8feb815008526499f80 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Tue, 24 Sep 2024 12:27:53 -0700 Subject: [PATCH] Compile RHS of binary expressions (oopsie) Not sure how this happened besides being a gigantic moron, I completely forgot to do `self.compile_expr(&expr.rhs)`. Signed-off-by: Alek Ratzloff --- src/compiler.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler.rs b/src/compiler.rs index 97e2ae2..4f9e3d2 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -796,6 +796,8 @@ impl ExprVisitor for Compiler<'_> { let constant_id = self.insert_constant(self.create_str(name))?; self.emit(expr_line_number(expr), Op::GetAttr(constant_id)); + self.compile_expr(&expr.rhs)?; + // convert RHS to a bool if we're doing AND or OR if let TokenKind::And | TokenKind::Or = expr.op.kind { let constant_id = self.insert_constant(self.create_str("to_bool"))?;