Handle calloc failure
for cfd8c7e6ca9f923cee3a062b548d0824fc67e9a5.
This commit is contained in:
parent
cfd8c7e6ca
commit
237cb94cf5
2
mjit.c
2
mjit.c
@ -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,
|
// 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.
|
// the thread is still being prepared and marking it causes SEGV.
|
||||||
cont = calloc(1, sizeof(struct mjit_cont));
|
cont = calloc(1, sizeof(struct mjit_cont));
|
||||||
|
if (cont == NULL)
|
||||||
|
rb_memerror();
|
||||||
cont->ec = ec;
|
cont->ec = ec;
|
||||||
|
|
||||||
CRITICAL_SECTION_START(3, "in mjit_cont_new");
|
CRITICAL_SECTION_START(3, "in mjit_cont_new");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user