diff options
Diffstat (limited to 'src/wasm/wasm.cpp')
-rw-r--r-- | src/wasm/wasm.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index 74b944bb6..188cd2d6f 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -920,18 +920,23 @@ void I31Get::finalize() { } void CallRef::finalize() { - handleUnreachableOperands(this); + if (handleUnreachableOperands(this)) { + return; + } if (isReturn) { type = Type::unreachable; + return; } if (target->type == Type::unreachable) { type = Type::unreachable; + return; } -} - -void CallRef::finalize(Type type_) { - type = type_; - finalize(); + assert(target->type.isRef()); + if (target->type.getHeapType().isBottom()) { + return; + } + assert(target->type.getHeapType().isSignature()); + type = target->type.getHeapType().getSignature().results; } void RefTest::finalize() { |