From 2c866ce8f0ff45e8d6d2941df174a2effe12a2dc Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert Date: Mon, 28 Sep 2020 17:01:26 -0400 Subject: [PATCH] Check if outlined code block has enough space too --- ujit_compile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ujit_compile.c b/ujit_compile.c index 9097d78b8a..1fcbda1ef3 100644 --- a/ujit_compile.c +++ b/ujit_compile.c @@ -193,6 +193,10 @@ ujit_compile_insn(rb_iseq_t *iseq, unsigned int insn_idx, unsigned int* next_uji { rb_bug("out of executable memory"); } + if (ocb->write_pos + 1024 >= ocb->mem_size) + { + rb_bug("out of executable memory (outlined block)"); + } // Align the current write positon to cache line boundaries cb_align_pos(cb, 64);