From 380a9ed970c832f93a10e51028b256efb4f08fa1 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Sun, 24 Apr 2005 23:02:48 +0000 Subject: [PATCH] ensure allocated code fits under 32-bit boundaries --- BasiliskII/src/uae_cpu/compiler/compemu_support.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BasiliskII/src/uae_cpu/compiler/compemu_support.cpp b/BasiliskII/src/uae_cpu/compiler/compemu_support.cpp index 89215138..db79ac9d 100644 --- a/BasiliskII/src/uae_cpu/compiler/compemu_support.cpp +++ b/BasiliskII/src/uae_cpu/compiler/compemu_support.cpp @@ -5704,7 +5704,10 @@ static uint8 *do_alloc_code(uint32 size, int depth) static inline uint8 *alloc_code(uint32 size) { - return do_alloc_code(size, 0); + uint8 *ptr = do_alloc_code(size, 0); + /* allocated code must fit in 32-bit boundaries */ + assert((uintptr)ptr <= 0xffffffff); + return ptr; } void alloc_cache(void)