target-ppc: Fix overallocation of opcode tables
PATCH 1/1 target-ppc: Fix overallocation of opcode tables
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 <[email protected]>
--- translate_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target-ppc/translate_init.c +1 -1
@@ -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 );
Quoted 13 lines · Stuart Brady
create_new_table()should allocate0x20opc_handler_tpointers, but actually allocates0x20opc_handler_tstructs. Fix this.Signed-off-by Stuart Brady <[email protected]>--- translate_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target-ppc/translate_init.c +0
-0
target-ppc/translate_init.c static int create_new_table (opc_handler_t **table, unsigned char idx) · line 7440
Quoted 8 lines
target-ppc/translate_init.c +1
-1@@ -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 );
Reviewed-by Tom Musta <[email protected]>
Tested-by Tom Musta <[email protected]>
Andreas Färber
AppliedAm 19.03.2014 16:14, schrieb Tom Musta:
Quoted 8 lines · Stuart Brady
Quoted 4 lines
create_new_table()should allocate0x20opc_handler_tpointers, but actually allocates0x20opc_handler_tstructs. Fix this.Signed-off-by Stuart Brady <[email protected]>Reviewed-by Tom Musta <[email protected]>Tested-by Tom Musta <[email protected]>
Thanks, applied to my ppc-next:
https://github.com/afaerber/qemu-cpu/commits/ppc-next
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg