[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] tci: Remove invalid assertions
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH] tci: Remove invalid assertions |
Date: |
Fri, 3 Feb 2017 00:12:57 +0200 |
On Thu, Feb 02, 2017 at 09:10:26PM +0100, Stefan Weil wrote:
> Am 02.02.2017 um 21:00 schrieb Eric Blake:
> > On 02/02/2017 01:56 PM, Stefan Weil wrote:
> > > tb_jmp_insn_offset and tb_jmp_reset_offset are pointers
> > > and cannot be used with ARRAY_SIZE.
> > >
> > > Signed-off-by: Stefan Weil <address@hidden>
> > > ---
> > > tcg/tci/tcg-target.inc.c | 2 --
> > > 1 file changed, 2 deletions(-)
> >
> > mst posted an alternative patch:
> > https://lists.gnu.org/archive/html/qemu-devel/2017-02/msg00551.html
>
>
> Yes, I noticed that, too. It's not obvious that this new
> assertion will be correct, and none of the other targets
> has that kind of assertion. Only two targets use an
> assertion which detects NULL pointers, but NULL pointers
> will result in an abort anyway.
>
> Do you think that there are reasons why TCI should use
> the assertion suggested by Michael?
>
> Stefan
You know what this code does and I don't, not really.
I just did a monkey patch guessing at what was intended
(value is used as an array index, so we do a bounds check).
I sent the patch before I saw yours simply to fix the build in a way
that's as unintrusive as possible: args[0] seemed to come from guest so
I thought it might be prudent to do a bounds check.
So feel free to ignore mine. Here's an ack for yours
Acked-by: Michael S. Tsirkin <address@hidden>
--
MST