summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index d5529f08b4..4f843e24e7 100644
--- a/eval.c
+++ b/eval.c
@@ -9971,7 +9971,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;