summaryrefslogtreecommitdiff
path: root/src/literal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/literal.h')
-rw-r--r--src/literal.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/literal.h b/src/literal.h
index ef3e13d44..bce578d46 100644
--- a/src/literal.h
+++ b/src/literal.h
@@ -65,7 +65,7 @@ public:
bool isNone() { return type == Type::none; }
static Literal makeFromInt32(int32_t x, Type type) {
- switch (type) {
+ switch (type.getSingle()) {
case Type::i32:
return Literal(int32_t(x));
break;
@@ -454,7 +454,7 @@ template<> struct hash<wasm::Literal> {
a.getBits(bytes);
int64_t chunks[2];
memcpy(chunks, bytes, sizeof(chunks));
- return wasm::rehash(wasm::rehash(uint64_t(hash<size_t>()(size_t(a.type))),
+ return wasm::rehash(wasm::rehash(uint64_t(hash<uint32_t>()(a.type.getID())),
uint64_t(hash<int64_t>()(chunks[0]))),
uint64_t(hash<int64_t>()(chunks[1])));
}
@@ -464,10 +464,10 @@ template<> struct less<wasm::Literal> {
if (a.type < b.type) {
return true;
}
- if (a.type > b.type) {
+ if (b.type < a.type) {
return false;
}
- switch (a.type) {
+ switch (a.type.getSingle()) {
case wasm::Type::i32:
return a.geti32() < b.geti32();
case wasm::Type::f32: