Re: [Qemu-devel] [PATCH 2/2] qdev: fix OVERFLOW_BEFORE_WIDEN

2015-06-23 Thread Gerd Hoffmann
On Di, 2015-06-23 at 09:53 +0800, arei.gong...@huawei.com wrote: > static uint64_t qdev_get_prop_mask64(Property *prop) > { > assert(prop->info == &qdev_prop_bit); > -return 0x1 << prop->bitnr; > +return 0x1ull << prop->bitnr; > } Reviewed-by: Gerd Hoffmann

Re: [Qemu-devel] [PATCH 2/2] qdev: fix OVERFLOW_BEFORE_WIDEN

2015-06-23 Thread Markus Armbruster
writes: > From: Gonglei > > Potentially overflowing expression "1 << prop->bitnr" with > type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, > and then used in a context that expects an expression of type > "uint64_t" (64 bits, unsigned). > > Cc: Gerd Hoffmann > Signed-off-by: Pa

[Qemu-devel] [PATCH 2/2] qdev: fix OVERFLOW_BEFORE_WIDEN

2015-06-22 Thread arei.gonglei
From: Gonglei Potentially overflowing expression "1 << prop->bitnr" with type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned). Cc: Gerd Hoffmann Signed-off-by: Paolo Bonzini Signed-off-by