1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add a pathologic check

This commit is contained in:
Nobuyoshi Nakada 2019-05-04 22:00:22 +09:00
parent 7d30cd47c4
commit b9e52db283
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

3
time.c
View file

@ -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;
}