Skip to content

Commit d669b5f

Browse files
authored
disambiguate hash usage (#1182)
1 parent 048bcad commit d669b5f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/literal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ namespace std {
158158
template<> struct hash<wasm::Literal> {
159159
size_t operator()(const wasm::Literal& a) const {
160160
return wasm::rehash(
161-
hash<size_t>()(size_t(a.type)),
162-
hash<int64_t>()(a.getBits())
161+
uint64_t(hash<size_t>()(size_t(a.type))),
162+
uint64_t(hash<int64_t>()(a.getBits()))
163163
);
164164
}
165165
};

src/support/hash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ inline uint32_t rehash(uint32_t x, uint32_t y) { // see http://www.cse.yorku.ca/
3535
return hash;
3636
}
3737

38-
inline size_t rehash(uint64_t x, uint64_t y) { // see boost and https://stackoverflow.com/a/2595226/1176841
38+
inline uint64_t rehash(uint64_t x, uint64_t y) { // see boost and https://stackoverflow.com/a/2595226/1176841
3939
return x ^ (y + 0x9e3779b9 + (x << 6) + (x >> 2));
4040
}
4141

0 commit comments

Comments
 (0)