diff --git a/src/machine.cpp b/src/machine.cpp index 33d1599f20..f05ba92d39 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -869,9 +869,10 @@ parsePoolEntry(Thread* t, Stream& s, uint32_t* index, object pool, unsigned i) parsePoolEntry(t, s, index, pool, ci); parsePoolEntry(t, s, index, pool, nti); - + object class_ = referenceName(t, singletonObject(t, pool, ci)); object nameAndType = singletonObject(t, pool, nti); + object value = makeReference (t, class_, pairFirst(t, nameAndType), pairSecond(t, nameAndType)); set(t, pool, SingletonBody + (i * BytesPerWord), value); @@ -3228,7 +3229,9 @@ isAssignableFrom(Thread* t, object a, object b) return isAssignableFrom (t, classStaticTable(t, a), classStaticTable(t, b)); } - } else { + } else if ((classVmFlags(t, a) & PrimitiveFlag) + == (classVmFlags(t, b) & PrimitiveFlag)) + { for (; b; b = classSuper(t, b)) { if (b == a) { return true; diff --git a/src/machine.h b/src/machine.h index 96c853624f..83ea2577a4 100644 --- a/src/machine.h +++ b/src/machine.h @@ -2164,6 +2164,8 @@ hashTaken(Thread*, object o) inline unsigned baseSize(Thread* t, object o, object class_) { + assert(t, classFixedSize(t, class_) >= BytesPerWord); + return ceiling(classFixedSize(t, class_), BytesPerWord) + ceiling(classArrayElementSize(t, class_) * cast(o, classFixedSize(t, class_) - BytesPerWord), diff --git a/test/Misc.java b/test/Misc.java index 7ff2f25378..450f23d2b0 100644 --- a/test/Misc.java +++ b/test/Misc.java @@ -235,5 +235,7 @@ public class Misc { System.out.println(75.62); System.out.println(75.62d); System.out.println(new char[] { 'h', 'i' }); + + expect(! (((Object) new int[0]) instanceof Object[])); } }