Skip to content

Commit

Permalink
Handle calloc failure
Browse files Browse the repository at this point in the history
for cfd8c7e.
  • Loading branch information
k0kubun committed Nov 24, 2020
1 parent cfd8c7e commit 237cb94
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mjit.c
Expand Up @@ -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");
Expand Down

0 comments on commit 237cb94

Please sign in to comment.