Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes LuaJIT#282: Incorrect range calculation in mcode_alloc()
Since 'range' in mcode_alloc() is calculated based on LJ_TARGET_JUMPRANGE-1, i.e. already half the available jump range, don't divide it by 2 again for randomized allocations. Also fix the number of bits argument to LJ_PRNG_BITS() to not generate excessive bits on architectures with LJ_TARGET_JUMPRANGE < 31. That wouldn't play well with the 0x78b constant being XORed with the generated random number apparently to improve PRNG properties, so that part has been removed. Improving PRNG will be addressed separately.
- Loading branch information