summaryrefslogtreecommitdiff
path: root/src/ir/literal-utils.h
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2020-03-16 10:35:08 -0700
committerGitHub <noreply@github.com>2020-03-16 10:35:08 -0700
commit2b8e9248604b2419a69c268ab131366a7408ebaf (patch)
treea33c06b2104f47692db494ee3c9358b4a05a8ec6 /src/ir/literal-utils.h
parent69d34c6bd9ad78f192cf4142b48a123eb61941ca (diff)
downloadbinaryen-2b8e9248604b2419a69c268ab131366a7408ebaf.tar.gz
binaryen-2b8e9248604b2419a69c268ab131366a7408ebaf.tar.bz2
binaryen-2b8e9248604b2419a69c268ab131366a7408ebaf.zip
Interpret tuple locals and tail-calls correctly (#2690)
Diffstat (limited to 'src/ir/literal-utils.h')
-rw-r--r--src/ir/literal-utils.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/ir/literal-utils.h b/src/ir/literal-utils.h
index 45119f2bd..abc48f636 100644
--- a/src/ir/literal-utils.h
+++ b/src/ir/literal-utils.h
@@ -32,18 +32,14 @@ inline Expression* makeFromInt32(int32_t x, Type type, Module& wasm) {
}
inline Expression* makeZero(Type type, Module& wasm) {
- // TODO: Switch to using v128.const once V8 supports it
+ // TODO: Remove this function once V8 supports v128.const
// (https://bugs.chromium.org/p/v8/issues/detail?id=8460)
+ Builder builder(wasm);
if (type == Type::v128) {
- Builder builder(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);
+ return builder.makeConstExpression(Literal::makeZero(type));
}
} // namespace LiteralUtils