]> git.proxmox.com Git - mirror_qemu.git/commit
migration/xbzrle: use ctz64 to avoid undefined result
authorMatheus Tavares Bernardino <quic_mathbern@quicinc.com>
Mon, 13 Mar 2023 18:58:19 +0000 (15:58 -0300)
committerJuan Quintela <quintela@redhat.com>
Thu, 16 Mar 2023 15:07:07 +0000 (16:07 +0100)
commitd84a78d15d3af9ff28ceec6906a4b101bd545b55
tree68b03cf41f925795e8ca59e711326959e3313664
parenta5382214d8b099bb2fe60b206097567762861800
migration/xbzrle: use ctz64 to avoid undefined result

__builtin_ctzll() produces undefined results when the argument is 0.
This can be seen through test-xbzrle, which produces the following
warning:

../migration/xbzrle.c:265: runtime error: passing zero to ctz(), which is not a valid argument

Replace __builtin_ctzll() with our ctz64() wrapper which properly
handles 0.

Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration/xbzrle.c