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:
parent
7d30cd47c4
commit
b9e52db283
1 changed files with 3 additions and 0 deletions
3
time.c
3
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue