summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h2
-rw-r--r--Userland/Libraries/LibWasm/Parser/Parser.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h
index 4f6169c2fa..94f5e29ce9 100644
--- a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h
+++ b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h
@@ -102,7 +102,7 @@ public:
Optional<T> result;
m_value.visit(
[&](auto value) {
- if constexpr (!IsSame<T, FunctionAddress> && !IsSame<T, ExternAddress>)
+ if constexpr (IsSame<T, decltype(value)>)
result = value;
},
[&](const FunctionAddress& address) {
diff --git a/Userland/Libraries/LibWasm/Parser/Parser.cpp b/Userland/Libraries/LibWasm/Parser/Parser.cpp
index 2dd0759b81..5a6ab098be 100644
--- a/Userland/Libraries/LibWasm/Parser/Parser.cpp
+++ b/Userland/Libraries/LibWasm/Parser/Parser.cpp
@@ -99,7 +99,9 @@ static ParseResult<ParseUntilAnyOfResult<T>> parse_until_any_of(InputStream& str
if (new_stream.has_any_error())
return with_eof_check(stream, ParseError::ExpectedValueOrTerminator);
- if ((... || (byte == terminators))) {
+ constexpr auto equals = [](auto&& a, auto&& b) { return a == b; };
+
+ if ((... || equals(byte, terminators))) {
result.terminator = byte;
return result;
}