On Wed, Jun 06, 2012 at 04:10:44PM +0200, Paolo Bonzini wrote:
> Il 06/06/2012 15:31, Andreas Färber ha scritto:
> >> > 
> >> > (a) add < 0 checks to <http://patchwork.ozlabs.org/patch/150427/> and
> >> >     include it in the series,
> >> > (b) make all Netdev integer types as strict as possible, remove
> >> >     superfluous checks,
> >> > (c) render NetLegacy::name optional.
> >> > 
> >> > How do I lay out (a)? Should I include the patch verbatim first (with
> >> > proper From: and Signed-off-by: lines) and then modify it in a small
> >> > followup, or squash those two and... what? :)
> > I am missing context here. The referenced patch is on qom-next already
> > and will thus be in my upcoming PULL (today or tomorrow) unless someone
> > comments on that patch, cc'ing me, that there's an error. Feel free to
> > cherry-pick from there but do not squash into random series please.
> > 
> > I don't understand what < 0 checks you are talking about, lacking time
> > to go through this QIDL patch series ATM.
> 
> The uintXX visitors do not fail if you pass a negative value.  I'm fine
> with including the patch with the small bug and fixing it as a
> follow-up, there's plenty of time before 1.2.

How would we implement such a check?

In the case of uint64_t, the field we're visiting is passed in as a
uint64_t*, so -1 is indistinguishable from the unsigned interpretation
of the field, which is within the valid range. 

For uintXX_t where XX < 64, a negative value would exceed the UINTXX_MAX
check, so those cases are already handled.

Or am I missing something?

> 
> Paolo
> 

Reply via email to