Skip to content

Commit 741f443

Browse files
committed
fix error
1 parent c07b788 commit 741f443

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

crates/luars/src/compiler/expr.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,14 @@ fn compile_binary_expr_to(
16371637
prev_b + 1, // Increase count by 1
16381638
0
16391639
);
1640+
1641+
// BUGFIX: Respect dest parameter
1642+
if let Some(d) = dest {
1643+
if d != left_reg {
1644+
emit_move(c, d, left_reg);
1645+
return Ok(d);
1646+
}
1647+
}
16401648
return Ok(left_reg);
16411649
}
16421650
}

crates/luars/src/test/test_math.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn test_math_deg_rad() {
135135
r#"
136136
local rad = math.rad(180)
137137
assert(rad > 3.14 and rad < 3.15)
138-
assert(math.deg(math.pi) > 179 and math.deg(math.pi) < 181)
138+
assert(math.deg(math.pi) >= 179 and math.deg(math.pi) <= 181)
139139
"#,
140140
);
141141

0 commit comments

Comments
 (0)