diff options
-rw-r--r-- | yjit_asm.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 <stdio.h> #include <stdlib.h> +#include <string.h> #include <stdarg.h> #include <assert.h> @@ -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; |