summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-08-21 14:58:57 -0700
committerGitHub <noreply@github.com>2024-08-21 14:58:57 -0700
commit21ddb853559bde490b4f02db576d4b8cd48d3106 (patch)
tree870e7a2915c9cb435030dc5e13911455424fcdc0 /src
parent7889abf8137291cc591cac8f38570789ebaf354d (diff)
downloadbinaryen-21ddb853559bde490b4f02db576d4b8cd48d3106.tar.gz
binaryen-21ddb853559bde490b4f02db576d4b8cd48d3106.tar.bz2
binaryen-21ddb853559bde490b4f02db576d4b8cd48d3106.zip
[NFC] hash constant string as void* (#6863)
possible-contents.h hashes the location for caught exnrefs by hashing an arbitrary string, "caught-exnref-location". It previously used `std::hash<const char*>` for this, but some standard library implementations report an error when this template instantiation is used because hashing the location of a string is almost never correct. In this case it is fine, so switch to using `std::hash<const void*>`.
Diffstat (limited to 'src')
-rw-r--r--src/ir/possible-contents.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ir/possible-contents.h b/src/ir/possible-contents.h
index 7b88483cf..945d59d26 100644
--- a/src/ir/possible-contents.h
+++ b/src/ir/possible-contents.h
@@ -620,7 +620,7 @@ template<> struct hash<wasm::TagLocation> {
template<> struct hash<wasm::CaughtExnRefLocation> {
size_t operator()(const wasm::CaughtExnRefLocation& loc) const {
- return std::hash<const char*>()("caught-exnref-location");
+ return std::hash<const void*>()("caught-exnref-location");
}
};