qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL for-2.0 04/13] target-ppc: Fix overallocation of opco


From: Andreas Färber
Subject: [Qemu-devel] [PULL for-2.0 04/13] target-ppc: Fix overallocation of opcode tables
Date: Thu, 20 Mar 2014 02:48:46 +0100

From: Stuart Brady <address@hidden>

create_new_table() should allocate 0x20 opc_handler_t pointers, but
actually allocates 0x20 opc_handler_t structs.  Fix this.

Signed-off-by: Stuart Brady <address@hidden>
Reviewed-by: Tom Musta <address@hidden>
Tested-by: Tom Musta <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
 target-ppc/translate_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 954dee3..3269c3e 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -7434,7 +7434,7 @@ static int create_new_table (opc_handler_t **table, 
unsigned char idx)
 {
     opc_handler_t **tmp;
 
-    tmp = g_malloc(0x20 * sizeof(opc_handler_t));
+    tmp = g_new(opc_handler_t *, 0x20);
     fill_new_table(tmp, 0x20);
     table[idx] = (opc_handler_t *)((uintptr_t)tmp | PPC_INDIRECT);
 
-- 
1.8.4.5




reply via email to

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