Skip to content

Commit

Permalink
fix(bb): initialize element::infinity() (#4664)
Browse files Browse the repository at this point in the history
Points at infinity are rare enough that we can initialize this to reduce
MSAN (C++ memory sanitizer) noise without performance loss. Caused
uninitialized memory errors in kzg test (which likely shouldn't be
creating points at infinity, anyway)
  • Loading branch information
ludamad authored Feb 19, 2024
1 parent 286e708 commit 6813540
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ template <class Fq, class Fr, class T> constexpr element<Fq, Fr, T> element<Fq,

template <class Fq, class Fr, class T> element<Fq, Fr, T> element<Fq, Fr, T>::infinity()
{
element<Fq, Fr, T> e;
element<Fq, Fr, T> e{};
e.self_set_infinity();
return e;
}
Expand Down

0 comments on commit 6813540

Please sign in to comment.