From c0ce87736511ca51e453509c25fe3c00abb08059 Mon Sep 17 00:00:00 2001 From: tarui Date: Mon, 10 Jun 2013 22:14:27 +0000 Subject: [PATCH] * eval_error.c (error_print): keep that errat is non-shady object. and guard errat from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ eval_error.c | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8df86eb28f..4f2aa3ddf8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jun 11 07:13:13 2013 Masaya Tarui + + * 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 * ext/racc/cparse/cparse.c: use rb_ary_entry() and diff --git a/eval_error.c b/eval_error.c index aa9d10f91d..c18ae34228 100644 --- a/eval_error.c +++ b/eval_error.c @@ -177,7 +177,6 @@ error_print(void) 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) #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",