mirror of
https://github.com/corda/corda.git
synced 2025-01-08 14:03:06 +00:00
check superclasses in fieldForOffset, not just immediate class
This commit is contained in:
parent
8590695f2d
commit
3e38628ad6
@ -2207,19 +2207,40 @@ pipeAvailable(int fd, int* available)
|
|||||||
}
|
}
|
||||||
|
|
||||||
object
|
object
|
||||||
fieldForOffset(Thread* t, object o, unsigned offset)
|
fieldForOffsetInClass(Thread* t, object c, unsigned offset)
|
||||||
{
|
{
|
||||||
object table = classFieldTable(t, objectClass(t, o));
|
object super = classSuper(t, c);
|
||||||
for (unsigned i = 0; i < objectArrayLength(t, table); ++i) {
|
if (super) {
|
||||||
object field = objectArrayBody(t, table, i);
|
object field = fieldForOffsetInClass(t, super, offset);
|
||||||
if ((fieldFlags(t, field) & ACC_STATIC) == 0
|
if (field) {
|
||||||
and fieldOffset(t, field) == offset)
|
|
||||||
{
|
|
||||||
return field;
|
return field;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abort(t);
|
object table = classFieldTable(t, c);
|
||||||
|
if (table) {
|
||||||
|
for (unsigned i = 0; i < objectArrayLength(t, table); ++i) {
|
||||||
|
object field = objectArrayBody(t, table, i);
|
||||||
|
if ((fieldFlags(t, field) & ACC_STATIC) == 0
|
||||||
|
and fieldOffset(t, field) == offset)
|
||||||
|
{
|
||||||
|
return field;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
object
|
||||||
|
fieldForOffset(Thread* t, object o, unsigned offset)
|
||||||
|
{
|
||||||
|
object field = fieldForOffsetInClass(t, objectClass(t, o), offset);
|
||||||
|
if (field) {
|
||||||
|
return field;
|
||||||
|
} else {
|
||||||
|
abort(t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace local
|
} // namespace local
|
||||||
|
Loading…
Reference in New Issue
Block a user