mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Revert addition of std::unreachable
After further testing with the fuzzer corpus, std::unreachable isn't necessary here. It's fine to just let the default case break to fix the Coverity warning.
This commit is contained in:
parent
f3568d148f
commit
58fb91315e
2 changed files with 2 additions and 17 deletions
|
@ -673,7 +673,7 @@ void POP3_Analyzer::ProcessReply(int length, const char* line) {
|
||||||
masterState = detail::POP3_UPDATE;
|
masterState = detail::POP3_UPDATE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default: util::unreachable();
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
POP3Event(pop3_reply, false, cmd, message);
|
POP3Event(pop3_reply, false, cmd, message);
|
||||||
|
@ -728,7 +728,7 @@ void POP3_Analyzer::ProcessReply(int length, const char* line) {
|
||||||
masterState == detail::POP3_START )
|
masterState == detail::POP3_START )
|
||||||
masterState = detail::POP3_FINISHED;
|
masterState = detail::POP3_FINISHED;
|
||||||
break;
|
break;
|
||||||
default: util::unreachable();
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
POP3Event(pop3_reply, false, cmd, message);
|
POP3Event(pop3_reply, false, cmd, message);
|
||||||
|
|
15
src/util.h
15
src/util.h
|
@ -661,20 +661,5 @@ inline std::vector<std::wstring_view> split(const wchar_t* s, const wchar_t* del
|
||||||
return split(std::wstring_view(s), std::wstring_view(delim));
|
return split(std::wstring_view(s), std::wstring_view(delim));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of std::unreachable. Once C++23 is supported this can be replaced with
|
|
||||||
* an alias. This implementation is taken from cppreference.
|
|
||||||
*/
|
|
||||||
[[noreturn]] inline void unreachable() {
|
|
||||||
// Uses compiler specific extensions if possible. Even if no extension is used,
|
|
||||||
// undefined behavior is still raised by an empty function body and the noreturn
|
|
||||||
// attribute.
|
|
||||||
#if defined(_MSC_VER) && ! defined(__clang__) // MSVC
|
|
||||||
__assume(false);
|
|
||||||
#else // GCC, Clang
|
|
||||||
__builtin_unreachable();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace util
|
} // namespace util
|
||||||
} // namespace zeek
|
} // namespace zeek
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue