зеркало из https://github.com/github/ruby.git
error.c: evaluate RARRAY_AREF once
* error.c (rb_check_backtrace): evaluate RARRAY_AREF only once. the first argument of RB_TYPE_P is expanded twice for non-immediate types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
a12c414d7e
Коммит
c81f8578c8
|
@ -1,3 +1,9 @@
|
||||||
|
Thu Jun 20 13:14:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* error.c (rb_check_backtrace): evaluate RARRAY_AREF only once.
|
||||||
|
the first argument of RB_TYPE_P is expanded twice for non-immediate
|
||||||
|
types.
|
||||||
|
|
||||||
Thu Jun 20 08:09:29 2013 Koichi Sasada <ko1@atdot.net>
|
Thu Jun 20 08:09:29 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* tool/gcbench.rb: Summary in one line.
|
* tool/gcbench.rb: Summary in one line.
|
||||||
|
|
3
error.c
3
error.c
|
@ -721,7 +721,8 @@ rb_check_backtrace(VALUE bt)
|
||||||
rb_raise(rb_eTypeError, err);
|
rb_raise(rb_eTypeError, err);
|
||||||
}
|
}
|
||||||
for (i=0;i<RARRAY_LEN(bt);i++) {
|
for (i=0;i<RARRAY_LEN(bt);i++) {
|
||||||
if (!RB_TYPE_P(RARRAY_AREF(bt, i), T_STRING)) {
|
VALUE e = RARRAY_AREF(bt, i);
|
||||||
|
if (!RB_TYPE_P(e, T_STRING)) {
|
||||||
rb_raise(rb_eTypeError, err);
|
rb_raise(rb_eTypeError, err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче