Skip to content

Commit

Permalink
Fix pairing of functions by type.
Browse files Browse the repository at this point in the history
Change `Differ::MatchFunctions` to use `GroupIdsAndMatchByMappedId`,
instead of calling `GroupIdsAndMatch` with
`Differ::GroupIdsHelperGetTypeId`, which is never correct: doing so
compares src and dst type ids directly, rather than consulting the
established mapping.

Fixes KhronosGroup#5226.
  • Loading branch information
jimblandy committed Jun 6, 2023
1 parent 5ed21eb commit 6226f04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/diff/diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,7 @@ void Differ::MatchFunctions() {

// If there are multiple functions with the same name, group them by
// type, and match only if the types match (and are unique).
GroupIdsAndMatch<uint32_t>(src_group, dst_group, 0,
GroupIdsAndMatchByMappedId(src_group, dst_group,
&Differ::GroupIdsHelperGetTypeId,
[this](const IdGroup& src_group_by_type_id,
const IdGroup& dst_group_by_type_id) {
Expand Down Expand Up @@ -2520,8 +2520,8 @@ void Differ::MatchFunctions() {
}

// Best effort match functions with matching type.
GroupIdsAndMatch<uint32_t>(
src_func_ids, dst_func_ids, 0, &Differ::GroupIdsHelperGetTypeId,
GroupIdsAndMatchByMappedId(
src_func_ids, dst_func_ids, &Differ::GroupIdsHelperGetTypeId,
[this](const IdGroup& src_group_by_type_id,
const IdGroup& dst_group_by_type_id) {
BestEffortMatchFunctions(src_group_by_type_id, dst_group_by_type_id,
Expand Down

0 comments on commit 6226f04

Please sign in to comment.