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().
This commit is contained in:
Behdad Esfahbod 2019-05-08 16:16:43 -07:00
parent 4c94bc63d9
commit afb013f350

View File

@ -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));