|
From: | Avi Kivity |
Subject: | Re: [Qemu-devel] [PATCH] Fix subtle integer overflow bug in memory API |
Date: | Thu, 15 Sep 2011 10:43:13 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux i686 on x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 |
On 09/15/2011 10:38 AM, Paolo Bonzini wrote:
On 09/15/2011 04:34 AM, David Gibson wrote:explicit "if (a + b)< a" tests in some places.Please wrap these in a macro, since the addition has to be done in an unsigned type. Otherwise overflow is undefined.
It doesn't help if the overflow is defined but produces an incorrect result.The fact is we need a 64+N bit datatype, where N is the nesting level of MemoryRegions (including aliases). Each nesting level can overflow a bit. Right now the only viable options seems to be #define 64 60, but I'll be happy to consider others.
-- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.
[Prev in Thread] | Current Thread | [Next in Thread] |