rb_th_serial(th) allows th == NULL

This commit is contained in:
Koichi Sasada 2023-04-04 15:42:37 +09:00
parent 822f01b36c
commit f3acaf312c

View File

@ -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 {