From 681e551369c83d3dbca368e0e6db1cc875f2d8a2 Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 12 Oct 2010 12:39:22 +0000 Subject: [PATCH] * error.c (exc_to_s): use OBJ_INFECT. * error.c (name_err_to_s): ditto. * error.c (name_err_mesg_to_str): ditto. * error.c (syserr_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 10 ++++++++++ error.c | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 220c1193d6..fe54476549 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Tue Oct 12 19:25:13 2010 NARUSE, Yui + + * error.c (exc_to_s): use OBJ_INFECT. + + * error.c (name_err_to_s): ditto. + + * error.c (name_err_mesg_to_str): ditto. + + * error.c (syserr_initialize): ditto. + Tue Oct 12 19:07:55 2010 NARUSE, Yui * error.c (syserr_initialize): taint message if mesg is given diff --git a/error.c b/error.c index 4ad252bde1..cbeb9ee391 100644 --- a/error.c +++ b/error.c @@ -501,7 +501,7 @@ exc_to_s(VALUE exc) VALUE mesg = rb_attr_get(exc, rb_intern("mesg")); if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc)); - if (OBJ_TAINTED(exc)) OBJ_TAINT(mesg); + OBJ_INFECT(mesg, exc); return mesg; } @@ -782,7 +782,7 @@ name_err_to_s(VALUE exc) if (str != mesg) { rb_iv_set(exc, "mesg", mesg = str); } - if (OBJ_TAINTED(exc)) OBJ_TAINT(mesg); + OBJ_INFECT(mesg, exc); return mesg; } @@ -911,7 +911,7 @@ name_err_mesg_to_str(VALUE obj) args[2] = d; mesg = rb_f_sprintf(NAME_ERR_MESG_COUNT, args); } - if (OBJ_TAINTED(obj)) OBJ_TAINT(mesg); + OBJ_INFECT(mesg, obj); return mesg; } @@ -1059,7 +1059,7 @@ syserr_initialize(int argc, VALUE *argv, VALUE self) if (le != me && rb_enc_asciicompat(me)) le = me; }/* else assume err is non ASCII string. */ - if (OBJ_TAINTED(str)) OBJ_TAINT(mesg); + OBJ_INFECT(mesg, str); rb_enc_associate(mesg, le); } else {