From fe15f2559f44377a40da50ff4fdbbc8438de8670 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Mon, 8 Aug 2022 16:57:28 +0000 Subject: [PATCH] [repacker] use position instead of memory address as key in device_tables map. --- src/graph/pairpos-graph.hh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/graph/pairpos-graph.hh b/src/graph/pairpos-graph.hh index 29dee54d4..769f29064 100644 --- a/src/graph/pairpos-graph.hh +++ b/src/graph/pairpos-graph.hh @@ -236,7 +236,7 @@ struct PairPosFormat2 : public OT::Layout::GPOS_impl::PairPosFormat2_4 split_points; - hb_hashmap_t device_tables = get_all_device_tables (c, this_index); + hb_hashmap_t device_tables = get_all_device_tables (c, this_index); hb_vector_t format1_device_table_indices = valueFormat1.get_device_table_indices (); hb_vector_t format2_device_table_indices = valueFormat2.get_device_table_indices (); bool has_device_tables = bool(format1_device_table_indices) || bool(format2_device_table_indices); @@ -315,7 +315,7 @@ struct PairPosFormat2 : public OT::Layout::GPOS_impl::PairPosFormat2_4& device_tables; + const hb_hashmap_t& device_tables; const hb_vector_t& format1_device_table_indices; const hb_vector_t& format2_device_table_indices; @@ -481,7 +481,8 @@ struct PairPosFormat2 : public OT::Layout::GPOS_impl::PairPosFormat2_4 + hb_hashmap_t get_all_device_tables (gsubgpos_graph_context_t& c, unsigned this_index) const { - hb_hashmap_t result; + hb_hashmap_t result; const auto& o = c.graph.object (this_index); for (const auto& l : o.real_links) { - result.set ((void*) (((uint8_t*)this) + l.position), l.objidx); + result.set (l.position, l.objidx); } return result; @@ -582,7 +583,7 @@ struct PairPosFormat2 : public OT::Layout::GPOS_impl::PairPosFormat2_4& device_tables, + const hb_hashmap_t& device_tables, const hb_vector_t device_table_indices, unsigned value_record_index, hb_set_t& visited) @@ -591,8 +592,9 @@ struct PairPosFormat2 : public OT::Layout::GPOS_impl::PairPosFormat2_4