From a2e0151728e443f2b901f830092fbc68de702312 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 27 Mar 2012 17:57:11 -0600 Subject: [PATCH] initialize Machine::OutOfMemoryError in writeBootImage2 If we don't initialize that at our first opportunity, it's possible we'll run out of memory later and exit silently instead of printing the error and returning a nonzero exit code. --- src/bootimage.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bootimage.cpp b/src/bootimage.cpp index 6ece510972..834431f7b4 100644 --- a/src/bootimage.cpp +++ b/src/bootimage.cpp @@ -1287,6 +1287,9 @@ writeBootImage2(Thread* t, FILE* bootimageOutput, FILE* codeOutput, BootImage* image, uint8_t* code, const char* className, const char* methodName, const char* methodSpec) { + setRoot(t, Machine::OutOfMemoryError, + make(t, type(t, Machine::OutOfMemoryErrorType))); + Zone zone(t->m->system, t->m->heap, 64 * 1024); object classPoolMap;