ruby-changes:20712
From: tadf <ko1@a...>
Date: Sat, 30 Jul 2011 23:49:52 +0900 (JST)
Subject: [ruby-changes:20712] tadf:r32760 (ruby_1_9_3): * ext/date/date_core.c: an issue that is same as .
tadf 2011-07-30 23:49:40 +0900 (Sat, 30 Jul 2011) New Revision: 32760 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32760 Log: * ext/date/date_core.c: an issue that is same as [ruby-dev:44071]. * ext/date/date_strftime.c: identical to [ruby-dev:44112]. Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/ext/date/date_core.c branches/ruby_1_9_3/ext/date/date_strftime.c Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 32759) +++ ruby_1_9_3/ChangeLog (revision 32760) @@ -1,3 +1,8 @@ +Sat Jul 30 23:48:04 2011 Tadayoshi Funaba <tadf@d...> + + * ext/date/date_core.c: an issue that is same as [ruby-dev:44071]. + * ext/date/date_strftime.c: identical to [ruby-dev:44112]. + Sat Jul 30 23:19:09 2011 Nobuyoshi Nakada <nobu@r...> * defs/default_gems: separate from tool/rbinstall.rb. Index: ruby_1_9_3/ext/date/date_core.c =================================================================== --- ruby_1_9_3/ext/date/date_core.c (revision 32759) +++ ruby_1_9_3/ext/date/date_core.c (revision 32760) @@ -4609,7 +4609,7 @@ get_d1a(self); if (simple_dat_p(adat)) { - VALUE new = d_lite_s_alloc_simple(CLASS_OF(self)); + VALUE new = d_lite_s_alloc_simple(rb_obj_class(self)); { get_d1b(new); bdat->s = adat->s; @@ -4617,7 +4617,7 @@ } } else { - VALUE new = d_lite_s_alloc_complex(CLASS_OF(self)); + VALUE new = d_lite_s_alloc_complex(rb_obj_class(self)); { get_d1b(new); bdat->c = adat->c; @@ -4632,7 +4632,7 @@ get_d1a(self); if (simple_dat_p(adat)) { - VALUE new = d_lite_s_alloc_complex(CLASS_OF(self)); + VALUE new = d_lite_s_alloc_complex(rb_obj_class(self)); { get_d1b(new); copy_simple_to_complex(&bdat->c, &adat->s); @@ -4641,7 +4641,7 @@ } } else { - VALUE new = d_lite_s_alloc_complex(CLASS_OF(self)); + VALUE new = d_lite_s_alloc_complex(rb_obj_class(self)); { get_d1b(new); bdat->c = adat->c; @@ -5553,14 +5553,14 @@ } if (simple_dat_p(dat)) - return d_simple_new_internal(CLASS_OF(self), + return d_simple_new_internal(rb_obj_class(self), nth, jd, dat->s.sg, 0, 0, 0, (dat->s.flags | HAVE_JD) & ~HAVE_CIVIL); else - return d_complex_new_internal(CLASS_OF(self), + return d_complex_new_internal(rb_obj_class(self), nth, jd, dat->c.df, dat->c.sf, dat->c.of, dat->c.sg, @@ -5618,14 +5618,14 @@ nth = f_add(m_nth(dat), nth); if (simple_dat_p(dat)) - return d_simple_new_internal(CLASS_OF(self), + return d_simple_new_internal(rb_obj_class(self), nth, jd, dat->s.sg, 0, 0, 0, (dat->s.flags | HAVE_JD) & ~HAVE_CIVIL); else - return d_complex_new_internal(CLASS_OF(self), + return d_complex_new_internal(rb_obj_class(self), nth, jd, dat->c.df, dat->c.sf, dat->c.of, dat->c.sg, @@ -5732,7 +5732,7 @@ nth = f_add(m_nth(dat), nth); if (!df && f_zero_p(sf) && !m_of(dat)) - return d_simple_new_internal(CLASS_OF(self), + return d_simple_new_internal(rb_obj_class(self), nth, (int)jd, m_sg(dat), 0, 0, 0, @@ -5740,7 +5740,7 @@ ~(HAVE_CIVIL | HAVE_TIME | COMPLEX_DAT)); else - return d_complex_new_internal(CLASS_OF(self), + return d_complex_new_internal(rb_obj_class(self), nth, (int)jd, df, sf, m_of(dat), m_sg(dat), @@ -5842,7 +5842,7 @@ nth = f_add(m_nth(dat), nth); if (!df && f_zero_p(sf) && !m_of(dat)) - return d_simple_new_internal(CLASS_OF(self), + return d_simple_new_internal(rb_obj_class(self), nth, jd, m_sg(dat), 0, 0, 0, @@ -5850,7 +5850,7 @@ ~(HAVE_CIVIL | HAVE_TIME | COMPLEX_DAT)); else - return d_complex_new_internal(CLASS_OF(self), + return d_complex_new_internal(rb_obj_class(self), nth, jd, df, sf, m_of(dat), m_sg(dat), Index: ruby_1_9_3/ext/date/date_strftime.c =================================================================== --- ruby_1_9_3/ext/date/date_strftime.c (revision 32759) +++ ruby_1_9_3/ext/date/date_strftime.c (revision 32760) @@ -212,7 +212,7 @@ if (precision > 0 || flags & (BIT_OF(LOCALE_E)|BIT_OF(LOCALE_O))) \ goto unknown; \ } while (0) -#define NEEDS(n) do if (s + (n) >= endp - 1) goto err; while (0) +#define NEEDS(n) do if (s >= endp || (n) >= endp - s - 1) goto err; while (0) #define FILL_PADDING(i) do { \ if (!(flags & BIT_OF(LEFT)) && precision > (i)) { \ NEEDS(precision); \ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/