Avoid hook called with unsupported arguments

This commit is contained in:
LoveSy 2024-08-09 10:58:09 +08:00
parent 897c70b74a
commit 56a9cf7e53
No known key found for this signature in database

View File

@ -97,9 +97,9 @@ struct HookHandler {
hook(dlsym<Sym>(), reinterpret_cast<void *>(hooker.replace_)))); hook(dlsym<Sym>(), reinterpret_cast<void *>(hooker.replace_))));
} }
template <typename... T> template <typename T1, typename T2, typename... U>
[[gnu::always_inline]] bool hook(T &...args) const { [[gnu::always_inline]] bool hook(T1 &arg1, T2 &arg2, U &...args) const {
return (hook(args) || ...); return ((hook(arg1) || hook(arg2)) || ... || hook(args));
} }
private: private: