git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
svn 2018-10-30 03:22:09 +00:00
Родитель 54726befc3
Коммит fae6c6bfd8
5 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -7761,18 +7761,18 @@ iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table,
if (RARRAY_LEN(v) != 6) { if (RARRAY_LEN(v) != 6) {
rb_raise(rb_eSyntaxError, "wrong exception entry"); rb_raise(rb_eSyntaxError, "wrong exception entry");
} }
type = get_exception_sym2type(RARRAY_AREF(v, 0)); type = get_exception_sym2type(RARRAY_AREF(v, 0));
if (RARRAY_AREF(v, 1) == Qnil) { if (RARRAY_AREF(v, 1) == Qnil) {
eiseq = NULL; eiseq = NULL;
} }
else { else {
eiseq = rb_iseqw_to_iseq(rb_iseq_load(RARRAY_AREF(v, 1), (VALUE)iseq, Qnil)); eiseq = rb_iseqw_to_iseq(rb_iseq_load(RARRAY_AREF(v, 1), (VALUE)iseq, Qnil));
} }
lstart = register_label(iseq, labels_table, RARRAY_AREF(v, 2)); lstart = register_label(iseq, labels_table, RARRAY_AREF(v, 2));
lend = register_label(iseq, labels_table, RARRAY_AREF(v, 3)); lend = register_label(iseq, labels_table, RARRAY_AREF(v, 3));
lcont = register_label(iseq, labels_table, RARRAY_AREF(v, 4)); lcont = register_label(iseq, labels_table, RARRAY_AREF(v, 4));
sp = NUM2UINT(RARRAY_AREF(v, 5)); sp = NUM2UINT(RARRAY_AREF(v, 5));
/* TODO: Dirty Hack! Fix me */ /* TODO: Dirty Hack! Fix me */
if (type == CATCH_TYPE_RESCUE || if (type == CATCH_TYPE_RESCUE ||
@ -7896,7 +7896,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
} }
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
VALUE obj = RARRAY_AREF(body, i); VALUE obj = RARRAY_AREF(body, i);
if (SYMBOL_P(obj)) { if (SYMBOL_P(obj)) {
rb_event_flag_t event; rb_event_flag_t event;

2
gc.c
Просмотреть файл

@ -1956,7 +1956,7 @@ newobj_of(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, int wb_protect
if (UNLIKELY(stress_to_class)) { if (UNLIKELY(stress_to_class)) {
long i, cnt = RARRAY_LEN(stress_to_class); long i, cnt = RARRAY_LEN(stress_to_class);
for (i = 0; i < cnt; ++i) { for (i = 0; i < cnt; ++i) {
if (klass == RARRAY_AREF(stress_to_class, i)) rb_memerror(); if (klass == RARRAY_AREF(stress_to_class, i)) rb_memerror();
} }
} }
#endif #endif

Просмотреть файл

@ -781,11 +781,11 @@ random_load(VALUE obj, VALUE dump)
Check_Type(dump, T_ARRAY); Check_Type(dump, T_ARRAY);
switch (RARRAY_LEN(dump)) { switch (RARRAY_LEN(dump)) {
case 3: case 3:
seed = RARRAY_AREF(dump, 2); seed = RARRAY_AREF(dump, 2);
case 2: case 2:
left = RARRAY_AREF(dump, 1); left = RARRAY_AREF(dump, 1);
case 1: case 1:
state = RARRAY_AREF(dump, 0); state = RARRAY_AREF(dump, 0);
break; break;
default: default:
rb_raise(rb_eArgError, "wrong dump data"); rb_raise(rb_eArgError, "wrong dump data");

Просмотреть файл

@ -3091,7 +3091,7 @@ rb_thread_to_s(VALUE thread)
if (!target_th->first_func && target_th->first_proc) { if (!target_th->first_func && target_th->first_proc) {
VALUE loc = rb_proc_location(target_th->first_proc); VALUE loc = rb_proc_location(target_th->first_proc);
if (!NIL_P(loc)) { if (!NIL_P(loc)) {
rb_str_catf(str, "@%"PRIsVALUE":%"PRIsVALUE, rb_str_catf(str, "@%"PRIsVALUE":%"PRIsVALUE,
RARRAY_AREF(loc, 0), RARRAY_AREF(loc, 1)); RARRAY_AREF(loc, 0), RARRAY_AREF(loc, 1));
rb_gc_force_recycle(loc); rb_gc_force_recycle(loc);
} }

Просмотреть файл

@ -1620,12 +1620,12 @@ native_set_thread_name(rb_thread_t *th)
size_t len; size_t len;
int n; int n;
name = RSTRING_PTR(RARRAY_AREF(loc, 0)); name = RSTRING_PTR(RARRAY_AREF(loc, 0));
p = strrchr(name, '/'); /* show only the basename of the path. */ p = strrchr(name, '/'); /* show only the basename of the path. */
if (p && p[1]) if (p && p[1])
name = p + 1; name = p + 1;
n = snprintf(buf, sizeof(buf), "%s:%d", name, NUM2INT(RARRAY_AREF(loc, 1))); n = snprintf(buf, sizeof(buf), "%s:%d", name, NUM2INT(RARRAY_AREF(loc, 1)));
rb_gc_force_recycle(loc); /* acts as a GC guard, too */ rb_gc_force_recycle(loc); /* acts as a GC guard, too */
len = (size_t)n; len = (size_t)n;