Skip to content

Commit

Permalink
fix: ensure condition is bool in api.Select
Browse files Browse the repository at this point in the history
  • Loading branch information
gbotrel committed Aug 13, 2024
1 parent 0c35f15 commit 8a96283
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/cs/scs/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ func (builder *builder) Select(b frontend.Variable, i1, i2 frontend.Variable) fr
return i1
}

// ensure the condition is a boolean
builder.AssertIsBoolean(b)

u := builder.Sub(i1, i2)
l := builder.Mul(u, b)

Expand Down

0 comments on commit 8a96283

Please sign in to comment.