From 49d8ccb1bdfecfa49eec051c6e3f2957b44b8b0c Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 9 Apr 2013 18:43:46 -0600 Subject: [PATCH] update Context::executableSize after allocating objectPool This ensures that, if an exception is thrown later but before the method has been fully compiled, we will know exactly how much memory to free. Previously, we would abort when trying to free the wrong amount due to an assertion failure. --- src/compile.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compile.cpp b/src/compile.cpp index fd5ebc1f74..8741fcddbd 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -7307,6 +7307,9 @@ finish(MyThread* t, FixedAllocator* allocator, Context* context) FixedSizeOfArray + ((context->objectPoolCount + 1) * BytesPerWord), true); + context->executableSize = (allocator->base + allocator->offset) + - static_cast(context->executableStart); + initArray(t, pool, context->objectPoolCount + 1); mark(t, pool, 0);