Type promotion for comparison

This commit is contained in:
Erica Fischer
2023-12-18 12:25:32 -08:00
parent 97867ecab0
commit 6f3256f5af
3 changed files with 104 additions and 0 deletions
+7
View File
@@ -798,6 +798,13 @@ struct sorter {
mvt_value av = a.value(attr);
mvt_value bv = b.value(attr);
av = av.promote_for_comparison_with(bv);
bv = bv.promote_for_comparison_with(av);
if (av.type != bv.type) {
fprintf(stderr, "Sorter: can't happen\n");
exit(EXIT_IMPOSSIBLE);
}
return av < bv;
}
};