ruby-changes:29172
From: tarui <ko1@a...>
Date: Tue, 11 Jun 2013 07:14:41 +0900 (JST)
Subject: [ruby-changes:29172] tarui:r41224 (trunk): * eval_error.c (error_print): keep that errat is non-shady object.
tarui 2013-06-11 07:14:27 +0900 (Tue, 11 Jun 2013) New Revision: 41224 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41224 Log: * eval_error.c (error_print): keep that errat is non-shady object. and guard errat from GC. Modified files: trunk/ChangeLog trunk/eval_error.c Index: ChangeLog =================================================================== --- ChangeLog (revision 41223) +++ ChangeLog (revision 41224) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Jun 11 07:13:13 2013 Masaya Tarui <tarui@r...> + + * eval_error.c (error_print): keep that errat is non-shady object. + and guard errat from GC. + Tue Jun 11 05:04:25 2013 Benoit Daloze <eregontp@g...> * ext/racc/cparse/cparse.c: use rb_ary_entry() and Index: eval_error.c =================================================================== --- eval_error.c (revision 41223) +++ eval_error.c (revision 41224) @@ -177,7 +177,6 @@ error_print(void) https://github.com/ruby/ruby/blob/trunk/eval_error.c#L177 if (!NIL_P(errat)) { long i; long len = RARRAY_LEN(errat); - VALUE *ptr = RARRAY_PTR(errat); int skip = eclass == rb_eSysStackError; #define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5) @@ -185,8 +184,8 @@ error_print(void) https://github.com/ruby/ruby/blob/trunk/eval_error.c#L184 #define TRACE_TAIL 5 for (i = 1; i < len; i++) { - if (RB_TYPE_P(ptr[i], T_STRING)) { - warn_printf("\tfrom %s\n", RSTRING_PTR(ptr[i])); + if (RB_TYPE_P(RARRAY_AREF(errat,i), T_STRING)) { + warn_printf("\tfrom %s\n", RSTRING_PTR(RARRAY_AREF(errat,i))); } if (skip && i == TRACE_HEAD && len > TRACE_MAX) { warn_printf("\t ... %ld levels...\n", -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/