From dae7b68d5cabf13a8960d365c9c16560d892a11f Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 30 Jun 2009 17:35:28 -0600 Subject: [PATCH] avoid indexing past the end of the array in makeSimpleFrameMapTable --- src/compile.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compile.cpp b/src/compile.cpp index 95549702e0..9abb064273 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -4744,8 +4744,10 @@ makeSimpleFrameMapTable(MyThread* t, Context* context, uint8_t* start, assert(t, context->traceLogCount + ceiling((i + 1) * mapSize, 32) <= intArrayLength(t, table)); - copyFrameMap(&intArrayBody(t, table, context->traceLogCount), p->map, - mapSize, i * mapSize, p, 0); + if (mapSize) { + copyFrameMap(&intArrayBody(t, table, context->traceLogCount), p->map, + mapSize, i * mapSize, p, 0); + } } return table;