Re: [Qemu-devel] [PATCH for-2.8 v2] hbitmap: Fix shifts of constants by granularity

2016-11-29 Thread Fam Zheng
On Tue, 11/15 23:47, Max Reitz wrote: > An hbitmap's granularity may be anything from 0 to 63, so when shifting > constants by its value, they should not be plain ints. > > Even having changed the types, hbitmap_serialization_granularity() still > tries to shift 64 to the right by the granularity.

[Qemu-devel] [PATCH for-2.8 v2] hbitmap: Fix shifts of constants by granularity

2016-11-15 Thread Max Reitz
An hbitmap's granularity may be anything from 0 to 63, so when shifting constants by its value, they should not be plain ints. Even having changed the types, hbitmap_serialization_granularity() still tries to shift 64 to the right by the granularity. This operation is undefined if the granularity