Remove a dangerous default from oatNew and fix the bug it hid.
Funnily enough, no-one was using the default on purpose anyway.
Change-Id: Id7b576565c1929087c05834078147dbbc8e635b3
diff --git a/src/compiler/CompilerUtility.h b/src/compiler/CompilerUtility.h
index d431678..5e8e993 100644
--- a/src/compiler/CompilerUtility.h
+++ b/src/compiler/CompilerUtility.h
@@ -27,7 +27,7 @@
/* Allocate the initial memory block for arena-based allocation */
bool oatHeapInit(CompilationUnit* cUnit);
-/* Collect memory usage statstics */
+/* Collect memory usage statistics */
//#define WITH_MEMSTATS
struct ArenaMemBlock {
@@ -37,8 +37,7 @@
char ptr[0];
};
-void* oatNew(CompilationUnit* cUnit, size_t size, bool zero,
- oatAllocKind kind = kAllocMisc);
+void* oatNew(CompilationUnit* cUnit, size_t size, bool zero, oatAllocKind kind);
void oatArenaReset(CompilationUnit *cUnit);
diff --git a/src/compiler/Frontend.cc b/src/compiler/Frontend.cc
index 5365d4a..a764583 100644
--- a/src/compiler/Frontend.cc
+++ b/src/compiler/Frontend.cc
@@ -868,7 +868,7 @@
/* Set up for simple method detection */
int numPatterns = sizeof(specialPatterns)/sizeof(specialPatterns[0]);
bool livePattern = (numPatterns > 0) && !(cUnit->disableOpt & (1 << kMatch));
- bool* deadPattern = (bool*)oatNew(cUnit.get(), sizeof(bool) * numPatterns,
+ bool* deadPattern = (bool*)oatNew(cUnit.get(), sizeof(bool) * numPatterns, true,
kAllocMisc);
SpecialCaseHandler specialCase = kNoHandler;
int patternPos = 0;