Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/ComputeCxx/Comparison/LayoutDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ bool compare_existential_values(const swift::existential_type_metadata &type, co
if (auto rhs_dynamic_type = type.dynamic_type((void *)rhs)) {
if (lhs_dynamic_type == rhs_dynamic_type) {
unsigned char *lhs_value = (unsigned char *)type.project_value((void *)lhs);
unsigned char *rhs_value = (unsigned char *)type.project_value((void *)lhs);
unsigned char *rhs_value = (unsigned char *)type.project_value((void *)rhs);
if (lhs_value == rhs_value) {
return true;
}
Expand All @@ -592,10 +592,10 @@ bool compare_existential_values(const swift::existential_type_metadata &type, co
options = options & ~IAGComparisonOptionsCopyOnWrite;
}

ValueLayout wrapped_layout = fetch(reinterpret_cast<const swift::metadata &>(type), options, 0);
ValueLayout wrapped_layout = fetch(*lhs_dynamic_type, options, 0);
ValueLayout layout = wrapped_layout == ValueLayoutTrivial ? nullptr : wrapped_layout;

return compare(layout, lhs_value, rhs_value, type.vw_size(), options);
return compare(layout, lhs_value, rhs_value, lhs_dynamic_type->vw_size(), options);
}
}
}
Expand Down