From 5f3c8265f2717f72d68d8eb170fbe2dd114d7b76 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Sat, 14 Jan 2023 13:20:48 +0000 Subject: fix lots more bugs, add better logging --- compiler_and_linker/unsorted/LoopDetection.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler_and_linker/unsorted/LoopDetection.c') diff --git a/compiler_and_linker/unsorted/LoopDetection.c b/compiler_and_linker/unsorted/LoopDetection.c index f1513e0..6bb2d51 100644 --- a/compiler_and_linker/unsorted/LoopDetection.c +++ b/compiler_and_linker/unsorted/LoopDetection.c @@ -281,11 +281,11 @@ void insertpreheaderblock(Loop *loop) { } else if (pcode27->op == PC_BCTR) { if (pcode27->argCount > 1 && pcode27->args[1].kind == PCOp_MEMORY) { Object *obj = pcode27->args[1].data.mem.obj; - PCodeLabel **array = (PCodeLabel **) obj->u.data.u.switchtable.data; + UInt32 *array = (UInt32 *) obj->u.data.u.switchtable.data; int i; for (i = 0; i < obj->u.data.u.switchtable.size; i++) { - if (array[i]->block == block28) - array[i] = preheader->labels; + if (((PCodeLabel *) CTool_ResolveIndexToPointer(array[i]))->block == block28) + array[i] = CTool_CreateIndexFromPointer(preheader->labels); } } else { CodeLabelList *cll; -- cgit v1.2.3