[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 13/14] tcg-i386: Use QEMU_BUILD_BUG_ON instead of
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v3 13/14] tcg-i386: Use QEMU_BUILD_BUG_ON instead of assert for frame size |
Date: |
Wed, 3 Jul 2013 14:29:27 -0700 |
We can check the condition at compile time, rather than run time.
Reviewed-by: Andreas Färber <address@hidden>
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 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;
--
1.8.1.4
- Re: [Qemu-devel] [PATCH v3 08/14] tcg-arm: Make use of conditional availability of opcodes for divide, (continued)
- [Qemu-devel] [PATCH v3 10/14] tcg-arm: Use AT_PLATFORM to detect the host ISA, Richard Henderson, 2013/07/03
- [Qemu-devel] [PATCH v3 11/14] tcg: Fix high_pc fields in .debug_info, Richard Henderson, 2013/07/03
- [Qemu-devel] [PATCH v3 12/14] tcg: Move the CIE and FDE header definitions to common code, Richard Henderson, 2013/07/03
- [Qemu-devel] [PATCH v3 13/14] tcg-i386: Use QEMU_BUILD_BUG_ON instead of assert for frame size,
Richard Henderson <=
- [Qemu-devel] [PATCH v3 14/14] tcg-arm: Implement tcg_register_jit, Richard Henderson, 2013/07/03
- Re: [Qemu-devel] [PATCH v3 00/14] tcg: remainder and tcg-arm updates, Claudio Fontana, 2013/07/04