From ab801dbdb7ff8a99b5e0976516b879b27bcf3e1b Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 3 Jul 1998 07:06:51 +0000 Subject: 1.1b9_29 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index f7852cbefb..a24ffc5872 100644 --- a/eval.c +++ b/eval.c @@ -981,27 +981,27 @@ ruby_run() case TAG_RETURN: error_pos(); - fprintf(stderr, "unexpected return\n"); + fprintf(stderr, ": unexpected return\n"); exit(1); break; case TAG_NEXT: error_pos(); - fprintf(stderr, "unexpected next\n"); + fprintf(stderr, ": unexpected next\n"); exit(1); break; case TAG_BREAK: error_pos(); - fprintf(stderr, "unexpected break\n"); + fprintf(stderr, ": unexpected break\n"); exit(1); break; case TAG_REDO: error_pos(); - fprintf(stderr, "unexpected redo\n"); + fprintf(stderr, ": unexpected redo\n"); exit(1); break; case TAG_RETRY: error_pos(); - fprintf(stderr, "retry outside of rescue clause\n"); + fprintf(stderr, ": retry outside of rescue clause\n"); exit(1); break; case TAG_RAISE: @@ -2340,6 +2340,9 @@ rb_eval(self, node) VALUE origin; int noex; + if (the_class == cObject && node->nd_mid == init) { + Warn("re-defining Object#initialize may cause infinite loop"); + } body = search_method(the_class, node->nd_mid, &origin); if (body) { if (origin == the_class) { @@ -2844,7 +2847,7 @@ rb_yield_0(val, self) int state; static unsigned serial = 1; - if (!iterator_p()) { + if (!iterator_p() || !the_block) { Raise(eLocalJumpError, "yield called out of iterator"); } @@ -6220,12 +6223,12 @@ thread_create(fn, arg) tval.it_interval.tv_usec = 100000; tval.it_value = tval.it_interval; setitimer(ITIMER_VIRTUAL, &tval, NULL); - +#if 1 tval.it_interval.tv_sec = 2; /* unblock system calls */ tval.it_interval.tv_usec = 0; tval.it_value = tval.it_interval; setitimer(ITIMER_REAL, &tval, NULL); - +#endif init = 1; } #endif -- cgit v1.2.3