summaryrefslogtreecommitdiff
path: root/src/ir/literal-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/literal-utils.h')
-rw-r--r--src/ir/literal-utils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ir/literal-utils.h b/src/ir/literal-utils.h
index 63a2b3b44..4bc79eee9 100644
--- a/src/ir/literal-utils.h
+++ b/src/ir/literal-utils.h
@@ -39,6 +39,10 @@ inline Expression* makeZero(Type type, Module& wasm) {
return builder.makeUnary(SplatVecI32x4,
builder.makeConst(Literal(int32_t(0))));
}
+ if (type.isRef()) {
+ Builder builder(wasm);
+ return builder.makeRefNull();
+ }
return makeFromInt32(0, type, wasm);
}