aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/eval.c b/eval.c
index f4b2328dde..352672b9db 100644
--- a/eval.c
+++ b/eval.c
@@ -478,6 +478,8 @@ rb_attr(klass, id, read, write, ex)
}
}
+extern int ruby_in_compile;
+
VALUE ruby_errinfo = Qnil;
extern NODE *ruby_eval_tree_begin;
extern NODE *ruby_eval_tree;
@@ -6892,7 +6894,6 @@ find_bad_fds(dst, src, max)
void
rb_thread_schedule()
{
- extern int ruby_in_compile;
rb_thread_t next; /* OK */
rb_thread_t th;
rb_thread_t curr;
@@ -6906,11 +6907,6 @@ rb_thread_schedule()
int n, max;
int need_select = 0;
- if (ruby_in_compile) {
- printf("switch during compilation.\n");
- abort();
- }
-
rb_thread_pending = 0;
if (curr_thread == curr_thread->next
&& curr_thread->status == THREAD_RUNNABLE)
@@ -7093,6 +7089,7 @@ rb_thread_wait_fd(fd)
int fd;
{
if (curr_thread == curr_thread->next) return;
+ if (ruby_in_compile) return;
curr_thread->status = THREAD_STOPPED;
curr_thread->fd = fd;