|
From: | Anastasia Belova |
Subject: | Re: [PATCH] hw/dma: prevent overflow in soc_dma_set_request |
Date: | Tue, 9 Apr 2024 16:31:27 +0300 |
User-agent: | RuPost Desktop |
09/04/24 15:02, Peter Maydell пишет:
On Tue, 9 Apr 2024 at 12:54, Anastasia Belova <abelova@astralinux.ru> wrote:ch->num can reach values up to 31. Add casting to a larger type before performing left shift to prevent integer overflow.If ch->num can only reach up to 31, then 1 << ch->num is fine, because QEMU can assume that integers are 32 bits, and we compile with -fwrapv so there isn't a problem with shifting into the sign bit.
Right, thanks for your comments. I didn't know about this flag before. It became more clear for me now. Thanks, Anastasia Belova
[Prev in Thread] | Current Thread | [Next in Thread] |