diff options
Diffstat (limited to 'src/wasm/literal.cpp')
-rw-r--r-- | src/wasm/literal.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp index dc6d90ef9..54e817189 100644 --- a/src/wasm/literal.cpp +++ b/src/wasm/literal.cpp @@ -35,7 +35,7 @@ Literal::Literal(Type type) : type(type) { i32 = 0; } else { assert(type != Type::unreachable && (!type.isRef() || type.isNullable())); - if (isGCData()) { + if (isData()) { new (&gcData) std::shared_ptr<GCData>(); } else if (type.isRtt()) { // Allocate a new RttSupers (with no data). @@ -55,7 +55,7 @@ Literal::Literal(std::shared_ptr<GCData> gcData, Type type) // Null data is only allowed if nullable. assert(gcData || type.isNullable()); // The type must be a proper type for GC data. - assert(isGCData()); + assert(isData()); } Literal::Literal(std::unique_ptr<RttSupers>&& rttSupers, Type type) @@ -64,7 +64,7 @@ Literal::Literal(std::unique_ptr<RttSupers>&& rttSupers, Type type) } Literal::Literal(const Literal& other) : type(other.type) { - if (other.isGCData()) { + if (other.isData()) { new (&gcData) std::shared_ptr<GCData>(other.gcData); return; } @@ -121,7 +121,7 @@ Literal::Literal(const Literal& other) : type(other.type) { } Literal::~Literal() { - if (isGCData()) { + if (isData()) { gcData.~shared_ptr(); } else if (type.isRtt()) { rttSupers.~unique_ptr(); @@ -241,7 +241,7 @@ std::array<uint8_t, 16> Literal::getv128() const { } std::shared_ptr<GCData> Literal::getGCData() const { - assert(isGCData()); + assert(isData()); return gcData; } @@ -486,7 +486,7 @@ std::ostream& operator<<(std::ostream& o, Literal literal) { o << "funcref(" << literal.getFunc() << ")"; } } else if (literal.type.isRef()) { - if (literal.isGCData()) { + if (literal.isData()) { auto data = literal.getGCData(); if (data) { o << "[ref " << data->rtt << ' ' << data->values << ']'; |