We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
(assert_return ... (ref.<non null>))
1 parent 3b6369e commit c555e12Copy full SHA for c555e12
src/tools/wasm-shell.cpp
@@ -368,7 +368,8 @@ struct Shell {
368
}
369
} else if (auto* ref = std::get_if<RefResult>(&expected)) {
370
if (!val.type.isRef() ||
371
- !HeapType::isSubType(val.type.getHeapType(), ref->type)) {
+ !HeapType::isSubType(val.type.getHeapType(), ref->type) ||
372
+ val.isNull()) {
373
err << ref->type;
374
return AlternativeErr{err.str()};
375
test/lit/basic/ref.wast
@@ -0,0 +1,10 @@
1
+;; RUN: not wasm-shell %s 2>&1 | filecheck %s
2
+
3
+(module
4
+ (func (export "f") (result (ref null i31))
5
+ (ref.null i31)
6
+ )
7
+)
8
9
+;; CHECK: expected i31, got nullref
10
+(assert_return (invoke "f") (ref.i31))
0 commit comments