mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +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
|
||||
fieldForOffset(Thread* t, object o, unsigned offset)
|
||||
fieldForOffsetInClass(Thread* t, object c, unsigned offset)
|
||||
{
|
||||
object table = classFieldTable(t, objectClass(t, o));
|
||||
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)
|
||||
{
|
||||
object super = classSuper(t, c);
|
||||
if (super) {
|
||||
object field = fieldForOffsetInClass(t, super, offset);
|
||||
if (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
|
||||
|
Loading…
Reference in New Issue
Block a user