qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-1.4] linux-user: Restore cast to target type


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH for-1.4] linux-user: Restore cast to target type in get_user()
Date: Thu, 31 Jan 2013 08:22:02 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 01/31/2013 04:50 AM, Peter Maydell wrote:
Commit 658f2dc97 accidentally dropped the cast to the target type of
the value loaded by get_user().  The most visible effect of this would
be that the sequence "uint64_t v; get_user_u32(v, addr)" would sign
extend the 32 bit loaded value into v rather than zero extending as
would be expected for a _u32 accessor.  Put the cast back again to
restore the old behaviour.

Signed-off-by: Peter Maydell<address@hidden>
---
  linux-user/qemu.h |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <address@hidden>

I now recall that I'd intended to go audit the uses of ld[us][bw]_p
and change the return type to be the "natural" one, which would not
have had this surprise.  But then failed to actually do so.

In the meantime this patch will produce correct results.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]