`rb_th_serial(th)` allows `th == NULL`

This commit is contained in:
Koichi Sasada 2023-04-04 15:42:37 +09:00
Родитель 822f01b36c
Коммит f3acaf312c
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1078,7 +1078,7 @@ typedef struct rb_thread_struct {
static inline unsigned int
rb_th_serial(const rb_thread_t *th)
{
return (unsigned int)th->serial;
return th ? (unsigned int)th->serial : 0;
}
typedef enum {