summaryrefslogtreecommitdiff
path: root/src/wasm-interpreter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r--src/wasm-interpreter.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index 008825632..4cb26d74a 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -1453,6 +1453,10 @@ public:
return cast;
}
seenRtt = Literal(Type(Rtt(0, func->sig)));
+ if (!seenRtt.isSubRtt(intendedRtt)) {
+ cast.outcome = cast.Failure;
+ return cast;
+ }
cast.castRef =
Literal(func->name, Type(intendedRtt.type.getHeapType(), NonNullable));
} else {
@@ -1460,14 +1464,14 @@ public:
assert(cast.originalRef.isData());
auto gcData = cast.originalRef.getGCData();
seenRtt = gcData->rtt;
+ if (!seenRtt.isSubRtt(intendedRtt)) {
+ cast.outcome = cast.Failure;
+ return cast;
+ }
cast.castRef =
Literal(gcData, Type(intendedRtt.type.getHeapType(), NonNullable));
}
- if (!seenRtt.isSubRtt(intendedRtt)) {
- cast.outcome = cast.Failure;
- } else {
- cast.outcome = cast.Success;
- }
+ cast.outcome = cast.Success;
return cast;
}