haze: event_reactor: fix size validation

This commit is contained in:
Liam 2023-04-16 19:06:55 -04:00
parent 70babc9c09
commit afcd7e7f93
2 changed files with 2 additions and 1 deletions

View file

@ -42,6 +42,7 @@ namespace haze {
public:
template <typename... Args>
Result WaitFor(s32 *out_arg_waiter, Args &&... arg_waiters) {
static_assert(sizeof...(Args) > 0);
const Waiter arg_waiter_array[] = { arg_waiters... };
return this->WaitForImpl(out_arg_waiter, arg_waiter_array, sizeof...(Args));
}

View file

@ -49,7 +49,7 @@ namespace haze {
}
Result EventReactor::WaitForImpl(s32 *out_arg_waiter, const Waiter *arg_waiters, s32 num_arg_waiters) {
HAZE_ASSERT(0 <= num_arg_waiters && num_arg_waiters <= svc::ArgumentHandleCountMax);
HAZE_ASSERT(0 < num_arg_waiters && num_arg_waiters <= svc::ArgumentHandleCountMax);
HAZE_ASSERT(m_num_wait_objects + num_arg_waiters <= svc::ArgumentHandleCountMax);
while (true) {