From patchwork Wed Jul 3 21:29:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 256764 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 705042C00A3 for ; Thu, 4 Jul 2013 08:03:36 +1000 (EST) Received: from localhost ([::1]:35222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuUht-0001xL-Vr for incoming@patchwork.ozlabs.org; Wed, 03 Jul 2013 17:35:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuUd2-0003Xo-GY for qemu-devel@nongnu.org; Wed, 03 Jul 2013 17:30:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuUd0-00062J-9F for qemu-devel@nongnu.org; Wed, 03 Jul 2013 17:30:20 -0400 Received: from mail-pd0-x229.google.com ([2607:f8b0:400e:c02::229]:52011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuUd0-000628-1y for qemu-devel@nongnu.org; Wed, 03 Jul 2013 17:30:18 -0400 Received: by mail-pd0-f169.google.com with SMTP id y10so469092pdj.0 for ; Wed, 03 Jul 2013 14:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=YyULlNF+VXWI5YcpoS+3bCQ3E3cMGvWPXnFQ2XHqwaM=; b=OvHmIT2w12tF2Sz+dYtWob+uEM5r1sGAEi+mzeBL7jggGYSscwoLD7PPyjLUOTz8By /VqQ0lK9D6RmymsU/tNnjGRm2hEfboaIJ+8m/sww6zBxM/EOGwz/xvArJE9j0EZV1tfx R7KBk4hOng5NeACSCwRp4VFs8RWRdbGRolyCvbrqlT6v+bPZBaRX67L6rqLIMCXHMsA8 iONoouzNow8s/hDekrfIdEwCOerFPGzr2DC4hRqXWzbW8+ZBrrvY0Wa2pL3X4Ybty2UI ruFgLu9T+ZVRyZmP2joOahM5jsmDWmdO+nwleb5VlflMMFd1a07nKlJb0g/dNfT51kes Hd9w== X-Received: by 10.66.252.168 with SMTP id zt8mr4289788pac.44.1372887017323; Wed, 03 Jul 2013 14:30:17 -0700 (PDT) Received: from fremont.twiddle.net (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPSA id s5sm13109431pbo.38.2013.07.03.14.30.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 03 Jul 2013 14:30:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 3 Jul 2013 14:29:27 -0700 Message-Id: <1372886968-17497-14-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1372886968-17497-1-git-send-email-rth@twiddle.net> References: <1372886968-17497-1-git-send-email-rth@twiddle.net> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::229 Cc: aliguori@us.ibm.com, claudio.fontana@huawei.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH v3 13/14] tcg-i386: Use QEMU_BUILD_BUG_ON instead of assert for frame size X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We can check the condition at compile time, rather than run time. Reviewed-by: Andreas Färber Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index ae3de09..87eeab3 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@ -2318,6 +2318,9 @@ typedef struct { uint8_t fde_reg_ofs[14]; } DebugFrame; +/* We're expecting a 2 byte uleb128 encoded value. */ +QEMU_BUILD_BUG_ON(FRAME_SIZE >= (1 << 14)); + #if !defined(__ELF__) /* Host machine without ELF. */ #elif TCG_TARGET_REG_BITS == 64 @@ -2381,9 +2384,6 @@ static DebugFrame debug_frame = { #if defined(ELF_HOST_MACHINE) void tcg_register_jit(void *buf, size_t buf_size) { - /* We're expecting a 2 byte uleb128 encoded value. */ - assert(FRAME_SIZE >> 14 == 0); - debug_frame.fde.func_start = (tcg_target_long) buf; debug_frame.fde.func_len = buf_size;