From f3acaf312c2a0069acd279edc0ceafcc34ddfdc3 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Tue, 4 Apr 2023 15:42:37 +0900 Subject: [PATCH] `rb_th_serial(th)` allows `th == NULL` --- vm_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm_core.h b/vm_core.h index 1ab61e10f4..4d4ed2387d 100644 --- a/vm_core.h +++ b/vm_core.h @@ -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 {