ensure allocated code fits under 32-bit boundaries

This commit is contained in:
gbeauche 2005-04-24 23:02:48 +00:00
parent 165b32da39
commit 380a9ed970

View File

@ -5704,7 +5704,10 @@ static uint8 *do_alloc_code(uint32 size, int depth)
static inline uint8 *alloc_code(uint32 size) 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) void alloc_cache(void)