[前][次][番号順一覧][スレッド一覧]

ruby-changes:63738

From: Takashi <ko1@a...>
Date: Tue, 24 Nov 2020 17:03:37 +0900 (JST)
Subject: [ruby-changes:63738] 237cb94cf5 (master): Handle calloc failure

https://git.ruby-lang.org/ruby.git/commit/?id=237cb94cf5

From 237cb94cf5676e8cfc81ca9f5e8d29e04e61fc4d Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Tue, 24 Nov 2020 00:02:48 -0800
Subject: Handle calloc failure

for cfd8c7e6ca9f923cee3a062b548d0824fc67e9a5.

diff --git a/mjit.c b/mjit.c
index 262298d..170f223 100644
--- a/mjit.c
+++ b/mjit.c
@@ -187,6 +187,8 @@ mjit_cont_new(rb_execution_context_t *ec) https://github.com/ruby/ruby/blob/trunk/mjit.c#L187
     // When this function is called from rb_thread_alloc through rb_threadptr_root_fiber_setup,
     // the thread is still being prepared and marking it causes SEGV.
     cont = calloc(1, sizeof(struct mjit_cont));
+    if (cont == NULL)
+        rb_memerror();
     cont->ec = ec;
 
     CRITICAL_SECTION_START(3, "in mjit_cont_new");
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]