qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 3/4] tcg-i386: Use QEMU_BUILD_BUG_ON instead


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v2 3/4] tcg-i386: Use QEMU_BUILD_BUG_ON instead of assert for frame size
Date: Tue, 18 Jun 2013 00:08:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

Am 05.06.2013 19:29, schrieb Richard Henderson:
> We can check the condition at compile time, rather than run time.
> 
> Signed-off-by: Richard Henderson <address@hidden>
> ---
>  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 7d946eb..991f484 100644
> --- a/tcg/i386/tcg-target.c
> +++ b/tcg/i386/tcg-target.c
> @@ -2324,6 +2324,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));

Reviewed-by: Andreas Färber <address@hidden>

Andreas

> +
>  #if !defined(__ELF__)
>      /* Host machine without ELF. */
>  #elif TCG_TARGET_REG_BITS == 64
> @@ -2387,9 +2390,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;
>  

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]