From 19d5022456b67e2fdc1d1a3be975c7c94170a4dd Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sat, 9 Jul 2011 18:01:00 -0600 Subject: [PATCH] fix GC safety bugs in getClassAddendum and makeArrayClass --- src/machine.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/machine.cpp b/src/machine.cpp index 44a131db2d..e47d5ffbc5 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -974,6 +974,8 @@ getClassAddendum(Thread* t, object class_, object pool) { object addendum = classAddendum(t, class_); if (addendum == 0) { + PROTECT(t, class_); + addendum = makeClassAddendum(t, pool, 0, 0, 0, 0, 0); set(t, class_, ClassAddendum, addendum); } @@ -1879,6 +1881,8 @@ makeArrayClass(Thread* t, object loader, unsigned dimensions, object spec, loader, arrayLength(t, vtable)); + PROTECT(t, c); + t->m->processor->initVtable(t, c); return c;