On 9/2/24 07:34, Richard Henderson wrote:
@@ -158,7 +158,7 @@ static uint64_t m5208_sys_read(void *opaque, hwaddr addr,
{
int n;
for (n = 0; n < 32; n++) {
- if (current_machine->ram_size < (2u << n)) {
+ if (current_machine->ram
On 8/31/24 03:34, Peter Maydell wrote:
In m5208_sys_read(), we have a loop of n from 0 to 31, and we
calculate (2u << n). For the n == 31 iteration this will shift off
the top of the unsigned 32 bit integer.
This is harmless, because we're going to stop the loop with n == 31
anyway, but we can
Am Fri, 30 Aug 2024 18:34:50 +0100
schrieb Peter Maydell :
> In m5208_sys_read(), we have a loop of n from 0 to 31, and we
> calculate (2u << n). For the n == 31 iteration this will shift off
> the top of the unsigned 32 bit integer.
>
> This is harmless, because we're going to stop the loop wit
In m5208_sys_read(), we have a loop of n from 0 to 31, and we
calculate (2u << n). For the n == 31 iteration this will shift off
the top of the unsigned 32 bit integer.
This is harmless, because we're going to stop the loop with n == 31
anyway, but we can avoid the error by using 64-bit arithmeti