Skip to content

Commit

Permalink
Fix double Enf in cas of Bindary::Eq
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo-Besancon committed Oct 18, 2024
1 parent 33e022d commit 7cadc6f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ir/src/passes/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,14 @@ impl<'a> MirBuilder<'a> {
// Enforce statements can be translated to Enf operations in the MIR on scalar expressions
ast::Statement::Enforce(scalar_expr) => {
let scalar_expr = self.insert_scalar_expr(scalar_expr)?;
self.insert_op(Operation::Enf(scalar_expr));

Ok(())
match self.mir.constraint_graph().node(&scalar_expr).op() {
Operation::Enf(_node_index) => Ok(()),
_ => {
self.insert_op(Operation::Enf(scalar_expr));
Ok(())
}
}

}
ast::Statement::EnforceIf(_, _) => unreachable!(), // This variant was only available after AST's inlining, we should handle EnforceAll instead
ast::Statement::EnforceAll(_list_comprehension) => {
Expand Down

0 comments on commit 7cadc6f

Please sign in to comment.