From 6813540731149db1f0d8932598335f95937ada03 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 19 Feb 2024 12:37:37 +0000 Subject: [PATCH] fix(bb): initialize element::infinity() (#4664) 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) --- barretenberg/cpp/src/barretenberg/ecc/groups/element_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/barretenberg/cpp/src/barretenberg/ecc/groups/element_impl.hpp b/barretenberg/cpp/src/barretenberg/ecc/groups/element_impl.hpp index e71f76c9253..78e3b6cccc3 100644 --- a/barretenberg/cpp/src/barretenberg/ecc/groups/element_impl.hpp +++ b/barretenberg/cpp/src/barretenberg/ecc/groups/element_impl.hpp @@ -494,7 +494,7 @@ template constexpr element element element element::infinity() { - element e; + element e{}; e.self_set_infinity(); return e; }