diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-23 11:17:00 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-23 11:17:00 +0000 |
commit | f99bed93302a0485b615dd651915d1262c1d1bcb (patch) | |
tree | 8bf4e6e1b6d7b72ea51ad03017eaccb268682bf4 | |
parent | e845e35fa31766f347abdb86bf69793d584537fc (diff) | |
download | ruby-f99bed93302a0485b615dd651915d1262c1d1bcb.tar.gz |
* ext/date/date_core.c: an issue that is same as [ruby-dev:44071].
* ext/date/date_strftime.c: identical to [ruby-dev:44112].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/date/date_core.c | 24 | ||||
-rw-r--r-- | ext/date/date_strftime.c | 2 |
3 files changed, 18 insertions, 13 deletions
@@ -1,3 +1,8 @@ +Sat Jul 23 20:11:50 2011 Tadayoshi Funaba <tadf@dotrb.org> + + * 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 23 19:12:53 2011 Masaki Suketa <masaki.suketa@nifty.ne.jp> * test/win32ole/test_err_in_callback.rb (test_err_in_callback): diff --git a/ext/date/date_core.c b/ext/date/date_core.c index 540b9f7387..08328b9e8f 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -4609,7 +4609,7 @@ dup_obj(VALUE self) 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 @@ dup_obj(VALUE self) } } 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 @@ dup_obj_as_complex(VALUE self) 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 @@ dup_obj_as_complex(VALUE self) } } 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 @@ d_lite_plus(VALUE self, VALUE other) } 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 @@ d_lite_plus(VALUE self, VALUE other) 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 @@ d_lite_plus(VALUE self, VALUE other) 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 @@ d_lite_plus(VALUE self, VALUE other) ~(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 @@ d_lite_plus(VALUE self, VALUE other) 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 @@ d_lite_plus(VALUE self, VALUE other) ~(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), diff --git a/ext/date/date_strftime.c b/ext/date/date_strftime.c index 02ad9a47ae..71e1bd7f00 100644 --- a/ext/date/date_strftime.c +++ b/ext/date/date_strftime.c @@ -212,7 +212,7 @@ date_strftime_with_tmx(char *s, size_t maxsize, const char *format, 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); \ |