diff --git a/yjit_asm.c b/yjit_asm.c index fc8472f077..78c9255d65 100644 --- a/yjit_asm.c +++ b/yjit_asm.c @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -154,6 +155,10 @@ uint8_t* alloc_exec_mem(uint32_t mem_size) exit(-1); } + // Fill the executable memory with 0x13 so that + // executing uninitialized memory will fault + memset(mem_block, 0xCC, mem_size); + return mem_block; #else return NULL;