Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions compiler/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1303,11 +1303,9 @@ impl<O: OutputStream> Compiler<O> {
self.emit(Instruction::Pop);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect the same change to be required for this line. Still I do not fully grasp the problem.

}
if let Some(false_label) = false_label {
self.emit(Instruction::Duplicate);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the test case as you mentioned in the pull request comment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This compile_test is fairly complex. It implements short circuit evaluation.

Please check carefully the logic of this function. I believe the EvalContext::Expression is for the case where an expression on the stack is desired.

It is probably a good idea to expand on our snippets here, so that we cover all cases.

self.emit(Instruction::JumpIfFalse {
target: false_label,
});
self.emit(Instruction::Pop);
}
}
}
Expand Down