Project

General

Profile

Bug #11935 ยป date-new-argument-errors.patch

Patch to ext/date/date_core.c from ruby 2.4.0dev - CJKinni (C Kinniburgh), 12/31/2015 06:01 PM

View differences:

ext/date/date_core.c (working copy)
fr2 = INT2FIX(0);
sg = DEFAULT_SG;
switch (argc) {
case 4:
val2sg(vsg, sg);
val2sg(vsg, sg);
case 3:
num2int_with_frac(d, positive_inf);
if (!(TYPE(vd) == T_FLOAT ||
TYPE(vd) == T_FIXNUM ||
TYPE(vd) == T_BIGNUM)) {
rb_raise(rb_eArgError, "invalid day");
}
num2int_with_frac(d, positive_inf);
case 2:
m = NUM2INT(vm);
if (!(TYPE(vm) == T_FLOAT ||
TYPE(vm) == T_FIXNUM ||
TYPE(vm) == T_BIGNUM)) {
rb_raise(rb_eArgError, "invalid month");
}
m = NUM2INT(vm);
case 1:
y = vy;
if (!(TYPE(vy) == T_FLOAT ||
TYPE(vy) == T_FIXNUM ||
TYPE(vy) == T_BIGNUM)) {
rb_raise(rb_eArgError, "invalid year");
}
y = vy;
}
if (guess_style(y, sg) < 0) {
    (1-1/1)