Skip to content

Commit 582d1e0

Browse files
committed
Revert PopJumpIfFalse for comparisons
1 parent 48f3772 commit 582d1e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/codegen/src/compile.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4115,10 +4115,14 @@ impl Compiler {
41154115
self.compile_addcompare(op);
41164116

41174117
// if comparison result is false, we break with this value; if true, try the next one.
4118+
/*
41184119
emit!(self, Instruction::CopyItem { index: 1 });
41194120
// emit!(self, Instruction::ToBool); // TODO: Uncomment this
41204121
emit!(self, Instruction::PopJumpIfFalse { target: cleanup });
41214122
emit!(self, Instruction::PopTop);
4123+
*/
4124+
4125+
emit!(self, Instruction::JumpIfFalseOrPop { target: cleanup });
41224126
}
41234127

41244128
self.compile_expression(last_comparator)?;

0 commit comments

Comments
 (0)