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 #5226.
  • Loading branch information
jimblandy committed May 22, 2023
1 parent 09888a1 commit 2fd1d5e
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 @@ -2444,7 +2444,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 @@ -2489,8 +2489,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) {

Expand Down

0 comments on commit 2fd1d5e

Please sign in to comment.