From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFVkL-0004xp-45 for qemu-devel@nongnu.org; Sat, 22 Sep 2012 15:52:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFVkJ-0002Xo-OB for qemu-devel@nongnu.org; Sat, 22 Sep 2012 15:52:12 -0400 Received: from hall.aurel32.net ([88.191.126.93]:41475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFVkJ-0002Xh-I7 for qemu-devel@nongnu.org; Sat, 22 Sep 2012 15:52:11 -0400 Date: Sat, 22 Sep 2012 21:52:09 +0200 From: Aurelien Jarno Message-ID: <20120922195209.GA32520@ohm.aurel32.net> References: <1348273096-1495-1-git-send-email-rth@twiddle.net> <1348273096-1495-8-git-send-email-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1348273096-1495-8-git-send-email-rth@twiddle.net> Subject: Re: [Qemu-devel] [PATCH 7/8] tcg: Sanity check deposit inputs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org On Fri, Sep 21, 2012 at 05:18:15PM -0700, Richard Henderson wrote: > Given these are constants, checking once here means everything > after can assume they're correct. > > Signed-off-by: Richard Henderson > --- > tcg/tcg-op.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h > index d2fb283..ecb1ac3 100644 > --- a/tcg/tcg-op.h > +++ b/tcg/tcg-op.h > @@ -2081,6 +2081,10 @@ static inline void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, > uint32_t mask; > TCGv_i32 t1; > > + tcg_debug_assert(ofs < 32); > + tcg_debug_assert(len <= 32); > + tcg_debug_assert(ofs + len <= 32); > + > if (ofs == 0 && len == 32) { > tcg_gen_mov_i32(ret, arg2); > return; > @@ -2112,6 +2116,10 @@ static inline void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, > uint64_t mask; > TCGv_i64 t1; > > + tcg_debug_assert(ofs < 64); > + tcg_debug_assert(len <= 64); > + tcg_debug_assert(ofs + len <= 64); > + > if (ofs == 0 && len == 64) { > tcg_gen_mov_i64(ret, arg2); > return; > -- > 1.7.11.4 > Reviewed-by: Aurelien Jarno -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net