From patchwork Thu Jul 4 20:41:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 257004 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 667EF2C008C for ; Fri, 5 Jul 2013 06:42:18 +1000 (EST) Received: from localhost ([::1]:51599 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuqM4-0005Ay-4G for incoming@patchwork.ozlabs.org; Thu, 04 Jul 2013 16:42:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuqLS-000534-UN for qemu-devel@nongnu.org; Thu, 04 Jul 2013 16:41:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuqLP-0002Ok-Uv for qemu-devel@nongnu.org; Thu, 04 Jul 2013 16:41:38 -0400 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]:48471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuqLP-0002Og-OU for qemu-devel@nongnu.org; Thu, 04 Jul 2013 16:41:35 -0400 Received: by mail-pa0-f41.google.com with SMTP id bj3so1609462pad.0 for ; Thu, 04 Jul 2013 13:41:35 -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=z73RTBLNcvjE+snhNjhz4HiIsxnqlipy1xl9O2EzIiKM5vVSsSajG/6UJreIoWawim CL0SEjaSDBsNLs/didS+B3X+Xz8nvir/JFu5a7GDpP9glQZxyC/5VfxkkFUO4Uf3yRI3 vdI1wP0j/Z8eNtJYGDzVtDDdGkr3HyJguoo6vYiZ901btst7XUldynU1FmYvP88/1/dD JZ0HHlnswA29/lDGNcfyS5EYdez5TRCXg5EoDMOPURja3xaARGBnJoFG+1V09P2RN0Tm nPkpMAJ3u5N3ANllzBaH7s9SwmwOBxJsFVvKVYT7J9vnhsgfzzYDrmxqqn5QhOmb63As OMEg== X-Received: by 10.68.227.36 with SMTP id rx4mr3144600pbc.1.1372970495030; Thu, 04 Jul 2013 13:41:35 -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 pb5sm4093184pbc.29.2013.07.04.13.41.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 04 Jul 2013 13:41:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 4 Jul 2013 13:41:01 -0700 Message-Id: <1372970462-10338-15-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1372970462-10338-1-git-send-email-rth@twiddle.net> References: <1372970462-10338-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:c03::229 Cc: peter.maydell@linaro.org, aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH v4 14/15] 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;