diff options
author | Lukas Larsson <lukas@erlang.org> | 2020-06-25 11:40:28 +0200 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2021-02-18 18:51:15 +0100 |
commit | 0b1820ed8789929547ee5ca04ac651bb415205a8 (patch) | |
tree | fbbce83f5266fd2294273c0fb2dd9afdcbb6932c /erts/emulator/sys/common/erl_poll.c | |
parent | f5dad8e079df14b3b705873b13796fd9725df1d2 (diff) | |
download | erlang-0b1820ed8789929547ee5ca04ac651bb415205a8.tar.gz |
erts: Add asserts to suppress false positives found by clang sa
Diffstat (limited to 'erts/emulator/sys/common/erl_poll.c')
-rw-r--r-- | erts/emulator/sys/common/erl_poll.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/erts/emulator/sys/common/erl_poll.c b/erts/emulator/sys/common/erl_poll.c index 9f0c82dc4b..d2c808a5a9 100644 --- a/erts/emulator/sys/common/erl_poll.c +++ b/erts/emulator/sys/common/erl_poll.c @@ -219,12 +219,12 @@ int ERTS_SELECT(int nfds, ERTS_fd_set *readfds, ERTS_fd_set *writefds, #else -#define ERTS_POLLSET_SET_HAVE_UPDATE_REQUESTS(PS) -#define ERTS_POLLSET_UNSET_HAVE_UPDATE_REQUESTS(PS) +#define ERTS_POLLSET_SET_HAVE_UPDATE_REQUESTS(PS) do {} while(0) +#define ERTS_POLLSET_UNSET_HAVE_UPDATE_REQUESTS(PS) do {} while(0) #define ERTS_POLLSET_HAVE_UPDATE_REQUESTS(PS) 0 -#define ERTS_POLLSET_LOCK(PS) -#define ERTS_POLLSET_UNLOCK(PS) +#define ERTS_POLLSET_LOCK(PS) do {} while(0) +#define ERTS_POLLSET_UNLOCK(PS) do {} while(0) #endif @@ -1154,6 +1154,8 @@ static int update_pollset(ErtsPollSet *ps, ErtsPollResFd pr[], int fd) int last_pix; if (reset) { + /* pr is only null during poll initialization and then no reset should happen */ + ASSERT(pr != NULL); /* When a fd has been reset, we tell the caller of erts_poll_wait this by setting the fd as ERTS_POLL_EV_NONE */ ERTS_POLL_RES_SET_FD(&pr[res], fd); |