2007-06-25 04:45:48 +04:00
|
|
|
/* -*-c-*- */
|
2006-12-31 18:02:22 +03:00
|
|
|
/*
|
|
|
|
* included by eval.c
|
|
|
|
*/
|
|
|
|
|
2016-03-06 11:34:50 +03:00
|
|
|
#if defined(__GNUC__) && !defined(__PCC__)
|
|
|
|
#define warn_print(x) __extension__ ( \
|
|
|
|
{ \
|
|
|
|
(__builtin_constant_p(x)) ? \
|
|
|
|
rb_write_error2((x), (long)strlen(x)) : \
|
|
|
|
rb_write_error(x); \
|
|
|
|
})
|
|
|
|
#else
|
2006-12-31 18:02:22 +03:00
|
|
|
#define warn_print(x) rb_write_error(x)
|
2016-03-06 11:34:50 +03:00
|
|
|
#endif
|
2010-12-12 07:28:29 +03:00
|
|
|
#define warn_print2(x,l) rb_write_error2((x),(l))
|
2013-06-24 17:03:35 +04:00
|
|
|
#define warn_print_str(x) rb_write_error_str(x)
|
2006-12-31 18:02:22 +03:00
|
|
|
|
2016-02-25 15:36:24 +03:00
|
|
|
static VALUE error_pos_str(void);
|
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
static void
|
|
|
|
error_pos(void)
|
2016-02-25 15:36:24 +03:00
|
|
|
{
|
|
|
|
VALUE str = error_pos_str();
|
|
|
|
if (!NIL_P(str)) {
|
|
|
|
warn_print_str(str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
|
|
|
error_pos_str(void)
|
2006-12-31 18:02:22 +03:00
|
|
|
{
|
2015-10-31 04:02:26 +03:00
|
|
|
int sourceline;
|
|
|
|
VALUE sourcefile = rb_source_location(&sourceline);
|
2007-06-25 00:33:04 +04:00
|
|
|
|
|
|
|
if (sourcefile) {
|
2013-05-25 02:03:41 +04:00
|
|
|
ID caller_name;
|
2007-06-25 00:33:04 +04:00
|
|
|
if (sourceline == 0) {
|
2016-02-25 15:36:24 +03:00
|
|
|
return rb_sprintf("%"PRIsVALUE": ", sourcefile);
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
2013-05-25 02:03:41 +04:00
|
|
|
else if ((caller_name = rb_frame_callee()) != 0) {
|
2016-02-25 15:36:24 +03:00
|
|
|
return rb_sprintf("%"PRIsVALUE":%d:in `%"PRIsVALUE"': ",
|
|
|
|
sourcefile, sourceline,
|
|
|
|
rb_id2str(caller_name));
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
else {
|
2016-02-25 15:36:24 +03:00
|
|
|
return rb_sprintf("%"PRIsVALUE":%d: ", sourcefile, sourceline);
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
}
|
2016-02-25 15:36:24 +03:00
|
|
|
return Qnil;
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
|
|
|
get_backtrace(VALUE info)
|
|
|
|
{
|
|
|
|
if (NIL_P(info))
|
|
|
|
return Qnil;
|
|
|
|
info = rb_funcall(info, rb_intern("backtrace"), 0);
|
|
|
|
if (NIL_P(info))
|
|
|
|
return Qnil;
|
2007-07-19 14:24:17 +04:00
|
|
|
return rb_check_backtrace(info);
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
|
* eval_method.c: renamed from vm_method.c. "vm_method.c" is included
by "vm.c".
* vm_eval.c: added. Some codes are moved from "eval.c"
* common.mk: fix for above changes.
* compile.c: make a vm_eval(0)
* eval.c, eval_error.c, eval_intern.h, eval_jump.c, proc.c, vm.c,
id.c, id.h, vm_core.h, vm_dump.c, vm_evalbody.c, vm_insnhelper.c,
blockinlining.c: fix for above changes. and do some refactoring.
this changes improve rb_yield() performance.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-24 21:50:17 +04:00
|
|
|
VALUE
|
|
|
|
rb_get_backtrace(VALUE info)
|
|
|
|
{
|
|
|
|
return get_backtrace(info);
|
|
|
|
}
|
|
|
|
|
2012-05-24 10:36:44 +04:00
|
|
|
VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt);
|
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
static void
|
|
|
|
set_backtrace(VALUE info, VALUE bt)
|
|
|
|
{
|
2012-05-24 10:09:23 +04:00
|
|
|
ID set_backtrace = rb_intern("set_backtrace");
|
|
|
|
|
|
|
|
if (rb_backtrace_p(bt)) {
|
2012-05-24 10:36:44 +04:00
|
|
|
if (rb_method_basic_definition_p(CLASS_OF(info), set_backtrace)) {
|
2012-05-24 10:09:23 +04:00
|
|
|
rb_exc_set_backtrace(info, bt);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
bt = rb_backtrace_to_str_ary(bt);
|
|
|
|
}
|
|
|
|
}
|
2006-12-31 18:02:22 +03:00
|
|
|
rb_funcall(info, rb_intern("set_backtrace"), 1, bt);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
error_print(void)
|
|
|
|
{
|
2013-06-10 10:34:28 +04:00
|
|
|
volatile VALUE errat = Qundef;
|
2010-06-21 18:43:58 +04:00
|
|
|
rb_thread_t *th = GET_THREAD();
|
|
|
|
VALUE errinfo = th->errinfo;
|
|
|
|
int raised_flag = th->raised_flag;
|
2013-06-10 10:34:28 +04:00
|
|
|
volatile VALUE eclass = Qundef, e = Qundef;
|
2009-02-28 14:12:36 +03:00
|
|
|
const char *volatile einfo;
|
|
|
|
volatile long elen;
|
2016-02-25 10:22:01 +03:00
|
|
|
VALUE mesg;
|
2006-12-31 18:02:22 +03:00
|
|
|
|
2007-10-03 05:06:57 +04:00
|
|
|
if (NIL_P(errinfo))
|
2006-12-31 18:02:22 +03:00
|
|
|
return;
|
2010-06-21 18:43:58 +04:00
|
|
|
rb_thread_raised_clear(th);
|
2006-12-31 18:02:22 +03:00
|
|
|
|
2012-10-24 00:42:45 +04:00
|
|
|
TH_PUSH_TAG(th);
|
|
|
|
if (TH_EXEC_TAG() == 0) {
|
2007-10-03 05:06:57 +04:00
|
|
|
errat = get_backtrace(errinfo);
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
2013-06-10 10:34:28 +04:00
|
|
|
else if (errat == Qundef) {
|
2006-12-31 18:02:22 +03:00
|
|
|
errat = Qnil;
|
|
|
|
}
|
2013-06-10 10:34:28 +04:00
|
|
|
else if (eclass == Qundef || e != Qundef) {
|
2006-12-31 18:02:22 +03:00
|
|
|
goto error;
|
2013-06-10 10:34:28 +04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
goto no_message;
|
|
|
|
}
|
2016-02-25 10:22:01 +03:00
|
|
|
if (NIL_P(errat) || RARRAY_LEN(errat) == 0 ||
|
|
|
|
NIL_P(mesg = RARRAY_AREF(errat, 0))) {
|
2006-12-31 18:02:22 +03:00
|
|
|
error_pos();
|
|
|
|
}
|
|
|
|
else {
|
2016-02-25 10:22:01 +03:00
|
|
|
warn_print_str(mesg);
|
|
|
|
warn_print(": ");
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
|
2007-10-03 05:06:57 +04:00
|
|
|
eclass = CLASS_OF(errinfo);
|
2013-06-10 10:36:02 +04:00
|
|
|
if (eclass != Qundef &&
|
|
|
|
(e = rb_check_funcall(errinfo, rb_intern("message"), 0, 0)) != Qundef &&
|
|
|
|
(RB_TYPE_P(e, T_STRING) || !NIL_P(e = rb_check_string_type(e)))) {
|
2006-12-31 18:02:22 +03:00
|
|
|
einfo = RSTRING_PTR(e);
|
|
|
|
elen = RSTRING_LEN(e);
|
|
|
|
}
|
|
|
|
else {
|
2013-06-10 10:34:28 +04:00
|
|
|
no_message:
|
2006-12-31 18:02:22 +03:00
|
|
|
einfo = "";
|
|
|
|
elen = 0;
|
|
|
|
}
|
|
|
|
if (eclass == rb_eRuntimeError && elen == 0) {
|
2016-02-25 07:42:16 +03:00
|
|
|
warn_print("unhandled exception\n");
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
VALUE epath;
|
|
|
|
|
|
|
|
epath = rb_class_name(eclass);
|
|
|
|
if (elen == 0) {
|
2013-06-24 17:03:35 +04:00
|
|
|
warn_print_str(epath);
|
2006-12-31 18:02:22 +03:00
|
|
|
warn_print("\n");
|
|
|
|
}
|
|
|
|
else {
|
2016-02-25 15:36:25 +03:00
|
|
|
const char *tail = 0;
|
2006-12-31 18:02:22 +03:00
|
|
|
long len = elen;
|
|
|
|
|
|
|
|
if (RSTRING_PTR(epath)[0] == '#')
|
|
|
|
epath = 0;
|
2007-08-18 11:44:51 +04:00
|
|
|
if ((tail = memchr(einfo, '\n', elen)) != 0) {
|
2006-12-31 18:02:22 +03:00
|
|
|
len = tail - einfo;
|
|
|
|
tail++; /* skip newline */
|
|
|
|
}
|
2014-11-29 00:11:22 +03:00
|
|
|
warn_print_str(tail ? rb_str_subseq(e, 0, len) : e);
|
2006-12-31 18:02:22 +03:00
|
|
|
if (epath) {
|
|
|
|
warn_print(" (");
|
2013-06-24 17:03:35 +04:00
|
|
|
warn_print_str(epath);
|
2006-12-31 18:02:22 +03:00
|
|
|
warn_print(")\n");
|
|
|
|
}
|
|
|
|
if (tail) {
|
2015-01-10 06:35:11 +03:00
|
|
|
warn_print_str(rb_str_subseq(e, tail - einfo, elen - len - 1));
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
2014-06-25 21:45:10 +04:00
|
|
|
if (tail ? einfo[elen-1] != '\n' : !epath) warn_print2("\n", 1);
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!NIL_P(errat)) {
|
|
|
|
long i;
|
|
|
|
long len = RARRAY_LEN(errat);
|
2007-06-20 03:27:47 +04:00
|
|
|
int skip = eclass == rb_eSysStackError;
|
2009-02-22 17:23:33 +03:00
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
#define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5)
|
|
|
|
#define TRACE_HEAD 8
|
|
|
|
#define TRACE_TAIL 5
|
|
|
|
|
|
|
|
for (i = 1; i < len; i++) {
|
2013-06-11 10:57:04 +04:00
|
|
|
VALUE line = RARRAY_AREF(errat, i);
|
|
|
|
if (RB_TYPE_P(line, T_STRING)) {
|
2016-02-25 15:36:24 +03:00
|
|
|
warn_print_str(rb_sprintf("\tfrom %"PRIsVALUE"\n", line));
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
2007-06-20 03:27:47 +04:00
|
|
|
if (skip && i == TRACE_HEAD && len > TRACE_MAX) {
|
2016-02-25 15:36:24 +03:00
|
|
|
warn_print_str(rb_sprintf("\t ... %ld levels...\n",
|
|
|
|
len - TRACE_HEAD - TRACE_TAIL));
|
2006-12-31 18:02:22 +03:00
|
|
|
i = len - TRACE_TAIL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
error:
|
2012-10-24 00:42:45 +04:00
|
|
|
TH_POP_TAG();
|
2013-06-10 10:35:37 +04:00
|
|
|
th->errinfo = errinfo;
|
2010-06-21 18:43:58 +04:00
|
|
|
rb_thread_raised_set(th, raised_flag);
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
|
2007-08-18 11:44:51 +04:00
|
|
|
void
|
|
|
|
ruby_error_print(void)
|
|
|
|
{
|
|
|
|
error_print();
|
|
|
|
}
|
|
|
|
|
2015-10-31 04:22:51 +03:00
|
|
|
#define undef_mesg_for(v, k) rb_fstring_cstr("undefined"v" method `%1$s' for "k" `%2$s'")
|
2015-10-28 09:24:12 +03:00
|
|
|
#define undef_mesg(v) ( \
|
|
|
|
is_mod ? \
|
|
|
|
undef_mesg_for(v, "module") : \
|
|
|
|
undef_mesg_for(v, "class"))
|
2014-07-26 20:13:21 +04:00
|
|
|
|
|
|
|
void
|
2016-01-03 07:59:54 +03:00
|
|
|
rb_print_undef(VALUE klass, ID id, rb_method_visibility_t visi)
|
2014-07-26 20:13:21 +04:00
|
|
|
{
|
2015-10-28 09:24:12 +03:00
|
|
|
const int is_mod = RB_TYPE_P(klass, T_MODULE);
|
|
|
|
VALUE mesg;
|
|
|
|
switch (visi & METHOD_VISI_MASK) {
|
|
|
|
case METHOD_VISI_UNDEF:
|
|
|
|
case METHOD_VISI_PUBLIC: mesg = undef_mesg(""); break;
|
|
|
|
case METHOD_VISI_PRIVATE: mesg = undef_mesg(" private"); break;
|
|
|
|
case METHOD_VISI_PROTECTED: mesg = undef_mesg(" protected"); break;
|
|
|
|
default: UNREACHABLE;
|
|
|
|
}
|
|
|
|
rb_name_err_raise_str(mesg, klass, ID2SYM(id));
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
|
2011-07-26 20:05:35 +04:00
|
|
|
void
|
|
|
|
rb_print_undef_str(VALUE klass, VALUE name)
|
|
|
|
{
|
2015-10-28 09:24:12 +03:00
|
|
|
const int is_mod = RB_TYPE_P(klass, T_MODULE);
|
|
|
|
rb_name_err_raise_str(undef_mesg(""), klass, name);
|
2011-07-26 20:05:35 +04:00
|
|
|
}
|
|
|
|
|
2015-10-28 09:24:12 +03:00
|
|
|
#define inaccessible_mesg_for(v, k) rb_fstring_cstr("method `%1$s' for "k" `%2$s' is "v)
|
|
|
|
#define inaccessible_mesg(v) ( \
|
|
|
|
is_mod ? \
|
|
|
|
inaccessible_mesg_for(v, "module") : \
|
|
|
|
inaccessible_mesg_for(v, "class"))
|
|
|
|
|
2014-07-26 20:13:21 +04:00
|
|
|
void
|
2015-06-03 04:39:16 +03:00
|
|
|
rb_print_inaccessible(VALUE klass, ID id, rb_method_visibility_t visi)
|
2014-07-26 20:13:21 +04:00
|
|
|
{
|
2015-10-28 09:24:12 +03:00
|
|
|
const int is_mod = RB_TYPE_P(klass, T_MODULE);
|
|
|
|
VALUE mesg;
|
|
|
|
switch (visi & METHOD_VISI_MASK) {
|
|
|
|
case METHOD_VISI_UNDEF:
|
|
|
|
case METHOD_VISI_PUBLIC: mesg = inaccessible_mesg(""); break;
|
|
|
|
case METHOD_VISI_PRIVATE: mesg = inaccessible_mesg(" private"); break;
|
|
|
|
case METHOD_VISI_PROTECTED: mesg = inaccessible_mesg(" protected"); break;
|
|
|
|
default: UNREACHABLE;
|
|
|
|
}
|
|
|
|
rb_name_err_raise_str(mesg, klass, ID2SYM(id));
|
2014-07-26 20:13:21 +04:00
|
|
|
}
|
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
static int
|
|
|
|
sysexit_status(VALUE err)
|
|
|
|
{
|
2015-02-23 10:05:30 +03:00
|
|
|
VALUE st = rb_ivar_get(err, id_status);
|
2006-12-31 18:02:22 +03:00
|
|
|
return NUM2INT(st);
|
|
|
|
}
|
|
|
|
|
2015-07-19 03:25:45 +03:00
|
|
|
#define unknown_longjmp_status(status) \
|
|
|
|
rb_bug("Unknown longjmp status %d", status)
|
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
static int
|
|
|
|
error_handle(int ex)
|
|
|
|
{
|
|
|
|
int status = EXIT_FAILURE;
|
* blockinlining.c, error.c, eval.c, eval_error.h, eval_intern.h,
eval_jump.h, eval_load.c, eval_safe.h, gc.c, proc.c, signal.c,
thread.c, thread_pthread.ci, thread_win32.ci, vm.c, vm.h,
vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
fix typo (rb_thead_t -> rb_thread_t).
* eval_intern.h: remove unused definitions.
* common.mk: fix around vm_opts.h path
and remove harmful argument passed to insns2vm.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-08 09:37:46 +03:00
|
|
|
rb_thread_t *th = GET_THREAD();
|
2006-12-31 18:02:22 +03:00
|
|
|
|
2009-06-08 20:14:06 +04:00
|
|
|
if (rb_threadptr_set_raised(th))
|
2006-12-31 18:02:22 +03:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
switch (ex & TAG_MASK) {
|
* call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci,
vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
fixed indents and non-C90 comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 19:26:04 +03:00
|
|
|
case 0:
|
2006-12-31 18:02:22 +03:00
|
|
|
status = EXIT_SUCCESS;
|
|
|
|
break;
|
|
|
|
|
* call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci,
vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
fixed indents and non-C90 comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 19:26:04 +03:00
|
|
|
case TAG_RETURN:
|
2006-12-31 18:02:22 +03:00
|
|
|
error_pos();
|
2016-02-25 07:42:16 +03:00
|
|
|
warn_print("unexpected return\n");
|
2006-12-31 18:02:22 +03:00
|
|
|
break;
|
* call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci,
vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
fixed indents and non-C90 comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 19:26:04 +03:00
|
|
|
case TAG_NEXT:
|
2006-12-31 18:02:22 +03:00
|
|
|
error_pos();
|
2016-02-25 07:42:16 +03:00
|
|
|
warn_print("unexpected next\n");
|
2006-12-31 18:02:22 +03:00
|
|
|
break;
|
* call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci,
vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
fixed indents and non-C90 comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 19:26:04 +03:00
|
|
|
case TAG_BREAK:
|
2006-12-31 18:02:22 +03:00
|
|
|
error_pos();
|
2016-02-25 07:42:16 +03:00
|
|
|
warn_print("unexpected break\n");
|
2006-12-31 18:02:22 +03:00
|
|
|
break;
|
* call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci,
vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
fixed indents and non-C90 comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 19:26:04 +03:00
|
|
|
case TAG_REDO:
|
2006-12-31 18:02:22 +03:00
|
|
|
error_pos();
|
2016-02-25 07:42:16 +03:00
|
|
|
warn_print("unexpected redo\n");
|
2006-12-31 18:02:22 +03:00
|
|
|
break;
|
* call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci,
vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
fixed indents and non-C90 comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 19:26:04 +03:00
|
|
|
case TAG_RETRY:
|
2006-12-31 18:02:22 +03:00
|
|
|
error_pos();
|
2016-02-25 07:42:16 +03:00
|
|
|
warn_print("retry outside of rescue clause\n");
|
2006-12-31 18:02:22 +03:00
|
|
|
break;
|
* call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci,
vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
fixed indents and non-C90 comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 19:26:04 +03:00
|
|
|
case TAG_THROW:
|
|
|
|
/* TODO: fix me */
|
2006-12-31 18:02:22 +03:00
|
|
|
error_pos();
|
2016-02-25 07:42:16 +03:00
|
|
|
warn_print("unexpected throw\n");
|
2006-12-31 18:02:22 +03:00
|
|
|
break;
|
2008-05-27 17:10:46 +04:00
|
|
|
case TAG_RAISE: {
|
2007-04-19 21:37:03 +04:00
|
|
|
VALUE errinfo = GET_THREAD()->errinfo;
|
|
|
|
if (rb_obj_is_kind_of(errinfo, rb_eSystemExit)) {
|
|
|
|
status = sysexit_status(errinfo);
|
|
|
|
}
|
2014-05-18 12:47:41 +04:00
|
|
|
else if (rb_obj_is_instance_of(errinfo, rb_eSignal) &&
|
2015-02-23 10:05:30 +03:00
|
|
|
rb_ivar_get(errinfo, id_signo) != INT2FIX(SIGSEGV)) {
|
2007-04-19 21:37:03 +04:00
|
|
|
/* no message when exiting by signal */
|
2006-12-31 18:02:22 +03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
error_print();
|
|
|
|
}
|
|
|
|
break;
|
2007-04-19 21:37:03 +04:00
|
|
|
}
|
2008-05-27 17:10:46 +04:00
|
|
|
case TAG_FATAL:
|
|
|
|
error_print();
|
|
|
|
break;
|
* call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci,
vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
fixed indents and non-C90 comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 19:26:04 +03:00
|
|
|
default:
|
2015-07-19 03:25:45 +03:00
|
|
|
unknown_longjmp_status(ex);
|
2006-12-31 18:02:22 +03:00
|
|
|
break;
|
|
|
|
}
|
2009-06-08 20:14:06 +04:00
|
|
|
rb_threadptr_reset_raised(th);
|
2006-12-31 18:02:22 +03:00
|
|
|
return status;
|
|
|
|
}
|