mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval_error.ci (get_backtrace): check the result more.
[ruby-dev:31261] [ruby-bugs-12398] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
09ce106ab3
commit
a1c76bc3de
3 changed files with 14 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Jul 19 19:24:14 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* eval_error.ci (get_backtrace): check the result more.
|
||||
[ruby-dev:31261] [ruby-bugs-12398]
|
||||
|
||||
Thu Jul 19 14:38:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* bignum.c (rb_big_lshift, rb_big_rshift): separated functions
|
||||
|
|
12
error.c
12
error.c
|
@ -495,14 +495,14 @@ exc_inspect(VALUE exc)
|
|||
static VALUE
|
||||
exc_backtrace(VALUE exc)
|
||||
{
|
||||
ID bt = rb_intern("bt");
|
||||
static ID bt;
|
||||
|
||||
if (!rb_ivar_defined(exc, bt)) return Qnil;
|
||||
return rb_ivar_get(exc, bt);
|
||||
if (!bt) bt = rb_intern("bt");
|
||||
return rb_attr_get(exc, bt);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
check_backtrace(VALUE bt)
|
||||
VALUE
|
||||
rb_check_backtrace(VALUE bt)
|
||||
{
|
||||
long i;
|
||||
static const char *err = "backtrace must be Array of String";
|
||||
|
@ -536,7 +536,7 @@ check_backtrace(VALUE bt)
|
|||
static VALUE
|
||||
exc_set_backtrace(VALUE exc, VALUE bt)
|
||||
{
|
||||
return rb_iv_set(exc, "bt", check_backtrace(bt));
|
||||
return rb_iv_set(exc, "bt", rb_check_backtrace(bt));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -66,6 +66,8 @@ error_pos(void)
|
|||
}
|
||||
}
|
||||
|
||||
VALUE rb_check_backtrace(VALUE);
|
||||
|
||||
static VALUE
|
||||
get_backtrace(VALUE info)
|
||||
{
|
||||
|
@ -74,7 +76,7 @@ get_backtrace(VALUE info)
|
|||
info = rb_funcall(info, rb_intern("backtrace"), 0);
|
||||
if (NIL_P(info))
|
||||
return Qnil;
|
||||
return rb_check_array_type(info);
|
||||
return rb_check_backtrace(info);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue