summaryrefslogtreecommitdiff
path: root/src/ir/table-utils.cpp
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2021-03-04 11:23:33 -0800
committerGitHub <noreply@github.com>2021-03-04 11:23:33 -0800
commitecd05546466494973fcc196a6661e0d5dfff6aa1 (patch)
tree042285779328ede7c8c938a3337f2f405917d6a9 /src/ir/table-utils.cpp
parent4a98c9a5d6061bf40c35ff5a5dce4c08606d6801 (diff)
downloadbinaryen-ecd05546466494973fcc196a6661e0d5dfff6aa1.tar.gz
binaryen-ecd05546466494973fcc196a6661e0d5dfff6aa1.tar.bz2
binaryen-ecd05546466494973fcc196a6661e0d5dfff6aa1.zip
Fix TypeComparator to satisfy C++'s Compare requirement (#3650)
The comparison implemented by TypeComparator was not previously antisymmetric because it held that both A < B and B < A when A and B were structurally identical but nominally distinct recursive types. This meant that it did not satisfy the conditions of C++'s "Compare" requirement, which meant that std::set did not operate correctly, as discovered in #3648. The PR fixes the problem by having making A < B be false (and vice versa), making type comparisons properly antisymmetric. As a drive by, also switches to using std::stable_sort in collectHeapTypes to make the order of the type section completely deterministic accross platforms. Fixes #3648.
Diffstat (limited to 'src/ir/table-utils.cpp')
0 files changed, 0 insertions, 0 deletions