1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Handle calloc failure

for cfd8c7e6ca.
This commit is contained in:
Takashi Kokubun 2020-11-24 00:02:48 -08:00
parent cfd8c7e6ca
commit 237cb94cf5
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

2
mjit.c
View file

@ -187,6 +187,8 @@ mjit_cont_new(rb_execution_context_t *ec)
// 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");