diff --git a/src/machine.cpp b/src/machine.cpp index 415ecee29a..77f5656ec0 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -3294,15 +3294,15 @@ resolveClass(Thread* t, object loader, object spec, bool throw_) } else { expect(t, throw_); + PROTECT(t, loader); + PROTECT(t, spec); + { object c = findLoadedClass(t, loader, spec); if (c) { return c; } } - PROTECT(t, loader); - PROTECT(t, spec); - if (byteArrayBody(t, spec, 0) == '[') { return resolveArrayClass(t, loader, spec, throw_); } else {