mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
fix bug in isAssignableFrom such that primitive array types were considered to be subclasses of the Object array type
This commit is contained in:
parent
b5fda8ee13
commit
c6ac66e45a
@ -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, ci);
|
||||||
parsePoolEntry(t, s, index, pool, nti);
|
parsePoolEntry(t, s, index, pool, nti);
|
||||||
|
|
||||||
object class_ = referenceName(t, singletonObject(t, pool, ci));
|
object class_ = referenceName(t, singletonObject(t, pool, ci));
|
||||||
object nameAndType = singletonObject(t, pool, nti);
|
object nameAndType = singletonObject(t, pool, nti);
|
||||||
|
|
||||||
object value = makeReference
|
object value = makeReference
|
||||||
(t, class_, pairFirst(t, nameAndType), pairSecond(t, nameAndType));
|
(t, class_, pairFirst(t, nameAndType), pairSecond(t, nameAndType));
|
||||||
set(t, pool, SingletonBody + (i * BytesPerWord), value);
|
set(t, pool, SingletonBody + (i * BytesPerWord), value);
|
||||||
@ -3228,7 +3229,9 @@ isAssignableFrom(Thread* t, object a, object b)
|
|||||||
return isAssignableFrom
|
return isAssignableFrom
|
||||||
(t, classStaticTable(t, a), classStaticTable(t, b));
|
(t, classStaticTable(t, a), classStaticTable(t, b));
|
||||||
}
|
}
|
||||||
} else {
|
} else if ((classVmFlags(t, a) & PrimitiveFlag)
|
||||||
|
== (classVmFlags(t, b) & PrimitiveFlag))
|
||||||
|
{
|
||||||
for (; b; b = classSuper(t, b)) {
|
for (; b; b = classSuper(t, b)) {
|
||||||
if (b == a) {
|
if (b == a) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -2164,6 +2164,8 @@ hashTaken(Thread*, object o)
|
|||||||
inline unsigned
|
inline unsigned
|
||||||
baseSize(Thread* t, object o, object class_)
|
baseSize(Thread* t, object o, object class_)
|
||||||
{
|
{
|
||||||
|
assert(t, classFixedSize(t, class_) >= BytesPerWord);
|
||||||
|
|
||||||
return ceiling(classFixedSize(t, class_), BytesPerWord)
|
return ceiling(classFixedSize(t, class_), BytesPerWord)
|
||||||
+ ceiling(classArrayElementSize(t, class_)
|
+ ceiling(classArrayElementSize(t, class_)
|
||||||
* cast<uintptr_t>(o, classFixedSize(t, class_) - BytesPerWord),
|
* cast<uintptr_t>(o, classFixedSize(t, class_) - BytesPerWord),
|
||||||
|
@ -235,5 +235,7 @@ public class Misc {
|
|||||||
System.out.println(75.62);
|
System.out.println(75.62);
|
||||||
System.out.println(75.62d);
|
System.out.println(75.62d);
|
||||||
System.out.println(new char[] { 'h', 'i' });
|
System.out.println(new char[] { 'h', 'i' });
|
||||||
|
|
||||||
|
expect(! (((Object) new int[0]) instanceof Object[]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user