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",