Skip to content

Commit

Permalink
rb_th_serial(th) allows th == NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
ko1 committed Apr 4, 2023
1 parent 822f01b commit f3acaf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vm_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f3acaf3

Please sign in to comment.