From a327eb95d9d82d255be1f2bcb152d5f6b6199767 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 5 Jul 2005 14:28:00 +0000 Subject: [PATCH] * eval.c (rb_thread_save_context): must not switch contexts during re-allocating stack. fixed: [ruby-core:05219] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 ++++- eval.c | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 34a1db9bdc..6bb6ad78ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,11 @@ -Tue Jul 5 23:23:09 2005 Nobuyoshi Nakada +Tue Jul 5 23:27:14 2005 Nobuyoshi Nakada * array.c (sort_2): get rid of yet another bcc's bug. fixed: [ruby-core:05152] + * eval.c (rb_thread_save_context): must not switch contexts during + re-allocating stack. fixed: [ruby-core:05219] + Tue Jul 5 15:15:10 2005 Hidetoshi NAGAI * ext/tk/tkutil.c: fix typo. diff --git a/eval.c b/eval.c index 7a4a50c537..8d612b5601 100644 --- a/eval.c +++ b/eval.c @@ -10329,7 +10329,9 @@ rb_thread_save_context(th) th->stk_len = 0; th->stk_pos = pos; if (len > th->stk_max) { - REALLOC_N(th->stk_ptr, VALUE, len); + VALUE *ptr = realloc(th->stk_ptr, sizeof(VALUE) * len); + if (!ptr) rb_memerror(); + th->stk_ptr = ptr; th->stk_max = len; } th->stk_len = len;