diff options
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | array.c | 5 | ||||
-rw-r--r-- | eval.c | 28 | ||||
-rw-r--r-- | intern.h | 1 | ||||
-rw-r--r-- | re.c | 6 | ||||
-rw-r--r-- | signal.c | 4 |
6 files changed, 57 insertions, 3 deletions
@@ -1,3 +1,19 @@ +Mon Apr 13 13:18:32 1998 Yukihiro Matsumoto <[email protected]> + + * eval.c (thread_trap_eval): all handlers executed under main_thread. + +Mon Apr 13 12:47:03 1998 TAKAHASHI Masayoshi <[email protected]> + + * re.c (kcode_set_option): did not SJIS on SJIS condition. + +Sun Apr 12 22:14:07 1998 Kazunori NISHI <[email protected]> + + * array.c (ary_uniq_bang): should be `==', not `='. embarrassing. + +Fri Apr 10 21:29:06 1998 Tadayoshi Funaba <[email protected]> + + * array.c (ary_subseq): add check for beg larger than array length. + Wed Apr 8 17:24:11 1998 MAEDA shugo <[email protected]> * dir.c (dir_s_open): can be called with block (like IO#open). @@ -306,6 +306,9 @@ ary_subseq(ary, beg, len) beg = RARRAY(ary)->len + beg; if (beg < 0) beg = 0; } + if (beg >= RARRAY(ary)->len) { + IndexError("out of range %d", beg); + } if (len < 0) { IndexError("negative length %d", RARRAY(ary)->len); } @@ -1164,7 +1167,7 @@ ary_uniq_bang(ary) } end = t; } - if (RARRAY(ary)->len = (end - RARRAY(ary)->ptr)) { + if (RARRAY(ary)->len == (end - RARRAY(ary)->ptr)) { return Qnil; } @@ -5386,6 +5386,8 @@ static int th_raise_argc; static VALUE th_raise_argv[2]; static char *th_raise_file; static int th_raise_line; +static VALUE th_cmd; +static int th_sig; static void thread_restore_context(th, exit) @@ -5442,6 +5444,10 @@ thread_restore_context(th, exit) break; case 3: + rb_trap_eval(th_cmd, th_sig); + break; + + case 4: the_frame->last_func = 0; sourcefile = th_raise_file; sourceline = th_raise_line; @@ -6244,6 +6250,26 @@ thread_interrupt() thread_restore_context(curr_thread, 2); } +void +thread_trap_eval(cmd, sig) + VALUE cmd; + int sig; +{ + thread_critical = 0; + thread_ready(main_thread); + if (curr_thread == main_thread) { + rb_trap_eval(cmd, sig); + } + thread_save_context(curr_thread); + if (setjmp(curr_thread->context)) { + return; + } + th_cmd = cmd; + th_sig = sig; + curr_thread = main_thread; + thread_restore_context(curr_thread, 3); +} + static VALUE thread_raise(argc, argv, thread) int argc; @@ -6269,7 +6295,7 @@ thread_raise(argc, argv, thread) th_raise_argc = argc; th_raise_file = sourcefile; th_raise_line = sourceline; - thread_restore_context(curr_thread, 3); + thread_restore_context(curr_thread, 4); return Qnil; /* not reached */ } @@ -135,6 +135,7 @@ void thread_sleep _((int)); void thread_sleep_forever _((void)); VALUE thread_create _((VALUE (*)(), void *)); void thread_interrupt _((void)); +void thread_trap_eval _((VALUE, int)); /* file.c */ VALUE file_open _((char *, char *)); int eaccess _((char *, int)); @@ -147,7 +147,7 @@ kcode_set_option(reg) mbcinit(MBCTYPE_EUC); break; case KCODE_SJIS: - mbcinit(MBCTYPE_EUC); + mbcinit(MBCTYPE_SJIS); break; } } @@ -883,6 +883,10 @@ reg_regsub(str, src, regs) char *ss = s; c = *s++; + if (ismbchar(c)) { + s++; + continue; + } if (c != '\\' || s == e) continue; if (!val) val = str_new(p, ss-p); @@ -341,7 +341,11 @@ rb_trap_exec() #endif return; } +#ifdef THREAD + thread_trap_eval(trap_list[i], i); +#else rb_trap_eval(trap_list[i], i); +#endif } } trap_pending = 0; |