diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2020-11-24 00:02:48 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2020-11-24 00:02:52 -0800 |
commit | 237cb94cf5676e8cfc81ca9f5e8d29e04e61fc4d (patch) | |
tree | 9b215e3b3ad1274ff1e93ce96656ea494fa2c7f8 /mjit.c | |
parent | cfd8c7e6ca9f923cee3a062b548d0824fc67e9a5 (diff) |
Handle calloc failure
for cfd8c7e6ca9f923cee3a062b548d0824fc67e9a5.
Diffstat (limited to 'mjit.c')
-rw-r--r-- | mjit.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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"); |