Commit bbc23b44 authored by Manos Koukoutos's avatar Manos Koukoutos Committed by Commit Bot

[wasm-gc] Fix type equivalence for rtts

Bug: v8:7748
Change-Id: I6087c02aab93ba44b8029f3d1a0c99fd6a4da6f8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2250248
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68423}
parent 6680837c
......@@ -65,6 +65,12 @@ bool IsStructTypeEquivalent(uint32_t type_index_1, uint32_t type_index_2,
bool IsEquivalent(ValueType type1, ValueType type2, const WasmModule* module) {
if (type1 == type2) return true;
if (type1.kind() != type2.kind()) return false;
// At this point, the types can only be both rtts, refs, or optrefs,
// but with different indexed types.
// Rtts need to have the same depth.
if (type1.has_depth() && type1.depth() != type2.depth()) return false;
// In all three cases, the indexed types have to be equivalent.
if (module->is_cached_equivalent_type(type1.ref_index(), type2.ref_index())) {
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment