diff --git a/src/hb-map.hh b/src/hb-map.hh index 8302e3f8c..30a8e627d 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -221,7 +221,7 @@ struct hb_hashmap_t unsigned int i = bucket_for (key); if (items[i].is_real () && items[i] == key) { - if (vp) *vp = &items[i].value; + if (vp) *vp = std::addressof (items[i].value); return true; } else diff --git a/src/test-map.cc b/src/test-map.cc index 357a8b01b..861166ef6 100644 --- a/src/test-map.cc +++ b/src/test-map.cc @@ -240,5 +240,15 @@ main (int argc, char **argv) m1->set (2,4); assert (!m.has (p2)); } + /* Test value type with hb_bytes_t. */ + { + hb_hashmap_t m; + char c_str[] = "Test"; + hb_bytes_t bytes (c_str, 4); + + m.set (1, bytes); + assert (m.has (1)); + } + return 0; }