summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2023-04-04 15:42:37 +0900
committerKoichi Sasada <ko1@atdot.net>2023-04-04 15:42:37 +0900
commitf3acaf312c2a0069acd279edc0ceafcc34ddfdc3 (patch)
tree5ff58e22723e0d30ed2010e1bdb7962d0cc1c249 /vm_core.h
parent822f01b36c7f9bf3b9f36eba3a508844908b7902 (diff)
downloadruby-f3acaf312c2a0069acd279edc0ceafcc34ddfdc3.tar.gz
`rb_th_serial(th)` allows `th == NULL`
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h2
1 files changed, 1 insertions, 1 deletions
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 {