From 8b0f7d790fdfd6027f7d93b1874304e93884a868 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sat, 7 Mar 2009 18:23:28 -0700 Subject: [PATCH] don't assume sizeof(bool) == 8 --- src/compile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compile.cpp b/src/compile.cpp index 3b33189ebd..93d7422638 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -4327,8 +4327,9 @@ compile(MyThread* t, Allocator* allocator, Context* context) PROTECT(t, eht); unsigned visitCount = exceptionHandlerTableLength(t, eht); + bool visited[visitCount]; - memset(visited, 0, visitCount); + memset(visited, 0, visitCount * sizeof(bool)); while (visitCount) { bool progress = false; @@ -4339,7 +4340,7 @@ compile(MyThread* t, Allocator* allocator, Context* context) ExceptionHandler* eh = exceptionHandlerTableBody(t, eht, i); unsigned start = exceptionHandlerStart(eh); - if (not visited[i] and context->visitTable[start]) { + if ((not visited[i]) and context->visitTable[start]) { -- visitCount; visited[i] = true; progress = true;