From afb013f350b0022ae6c05f140aeba23d5de34101 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 8 May 2019 16:16:43 -0700 Subject: [PATCH] Fix msan issue hb_identity returns rvalue-reference if input is rvalue. That, can leak the reference and cause in bad access to temporaries after they are destructed. This is unfortunately unfixable given the desired transparency of hb_identity :(. Just don't use it with hb_map(). --- src/test-iter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test-iter.cc b/src/test-iter.cc index 0a0e4d102..944c234f5 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -161,7 +161,7 @@ main (int argc, char **argv) test_iterator_non_default_constructable (hb_enumerate (hb_iter (st))); test_iterator_non_default_constructable (hb_enumerate (hb_iter (st) + 1)); test_iterator_non_default_constructable (hb_iter (st) | hb_filter ()); - test_iterator_non_default_constructable (hb_iter (st) | hb_map (hb_identity)); + test_iterator_non_default_constructable (hb_iter (st) | hb_map (hb_rvalue)); assert (true == hb_all (st)); assert (false == hb_all (st, 42u));