diff --git a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h index 4f6169c2fa8..94f5e29ce9a 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h +++ b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h @@ -102,7 +102,7 @@ public: Optional result; m_value.visit( [&](auto value) { - if constexpr (!IsSame && !IsSame) + if constexpr (IsSame) result = value; }, [&](const FunctionAddress& address) { diff --git a/Userland/Libraries/LibWasm/Parser/Parser.cpp b/Userland/Libraries/LibWasm/Parser/Parser.cpp index 2dd0759b816..5a6ab098bee 100644 --- a/Userland/Libraries/LibWasm/Parser/Parser.cpp +++ b/Userland/Libraries/LibWasm/Parser/Parser.cpp @@ -99,7 +99,9 @@ static ParseResult> 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; }