From b9e52db28398c5a792ae16730243af764c869bcd Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 4 May 2019 22:00:22 +0900 Subject: [PATCH] Add a pathologic check --- time.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/time.c b/time.c index 2630f735bf..2086dcd22e 100644 --- a/time.c +++ b/time.c @@ -4627,6 +4627,9 @@ time_isdst(VALUE time) GetTimeval(time, tobj); MAKE_TM(time, tobj); + if (tobj->vtm.isdst == VTM_ISDST_INITVAL) { + rb_raise(rb_eRuntimeError, "isdst is not set yet"); + } return tobj->vtm.isdst ? Qtrue : Qfalse; }