diff options
| author | Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> | 2020-09-28 17:01:26 -0400 |
|---|---|---|
| committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:24 -0400 |
| commit | 2c866ce8f0ff45e8d6d2941df174a2effe12a2dc (patch) | |
| tree | aba46f1e3fb09b20b663cd0450c72854312b6ebe | |
| parent | e8c914c2502f6049ebc5bd93e8db0c62dd14400e (diff) | |
Check if outlined code block has enough space too
| -rw-r--r-- | ujit_compile.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |
