summaryrefslogtreecommitdiff
path: root/src/ir/properties.h
diff options
context:
space:
mode:
authorDaniel Wirtz <dcode@dcode.io>2020-09-09 03:40:09 +0200
committerGitHub <noreply@github.com>2020-09-09 03:40:09 +0200
commit916ce6f1a9f7c85102a8c69f593b301c8df5d19d (patch)
tree93b22be9f2c0718248528d140b05221cb6878600 /src/ir/properties.h
parent0fdcf5b51a0c8c379b2d3ad8262aa22bb234f0e9 (diff)
downloadbinaryen-916ce6f1a9f7c85102a8c69f593b301c8df5d19d.tar.gz
binaryen-916ce6f1a9f7c85102a8c69f593b301c8df5d19d.tar.bz2
binaryen-916ce6f1a9f7c85102a8c69f593b301c8df5d19d.zip
Update reference types (#3084)
Align with the current state of the reference types proposal: * Remove `nullref` * Remove `externref` and `funcref` subtyping * A `Literal` of a nullable reference type can now represent `null` (previously was type `nullref`) * Update the tests and temporarily comment out those tests relying on subtyping
Diffstat (limited to 'src/ir/properties.h')
-rw-r--r--src/ir/properties.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ir/properties.h b/src/ir/properties.h
index 0c6824e4a..ac61f787e 100644
--- a/src/ir/properties.h
+++ b/src/ir/properties.h
@@ -93,10 +93,10 @@ inline bool isConstantExpression(const Expression* curr) {
inline Literal getSingleLiteral(const Expression* curr) {
if (auto* c = curr->dynCast<Const>()) {
return c->value;
- } else if (curr->is<RefNull>()) {
- return Literal(Type::nullref);
- } else if (auto* c = curr->dynCast<RefFunc>()) {
- return Literal(c->func);
+ } else if (auto* n = curr->dynCast<RefNull>()) {
+ return Literal(n->type);
+ } else if (auto* r = curr->dynCast<RefFunc>()) {
+ return Literal(r->func);
} else {
WASM_UNREACHABLE("non-constant expression");
}