mirror of
https://github.com/corda/corda.git
synced 2025-01-21 03:55:00 +00:00
filter InnerClasses attribute for relevant classes in JVM_GetDeclaredClasses
The InnerClasses attribute may have entries for classes declared inside classes we don't care about, so we must check each entry's outer class reference and make sure it matches the one we do care about.
This commit is contained in:
parent
63ee3ab0a2
commit
e3fe9099a2
@ -4448,7 +4448,10 @@ jvmGetDeclaredClasses(Thread* t, uintptr_t* arguments)
|
||||
|
||||
unsigned count = 0;
|
||||
for (unsigned i = 0; i < arrayLength(t, table); ++i) {
|
||||
if (innerClassReferenceOuter(t, arrayBody(t, table, i))) {
|
||||
object outer = innerClassReferenceOuter(t, arrayBody(t, table, i));
|
||||
if (outer and byteArrayEqual
|
||||
(t, outer, className(t, jclassVmClass(t, *c))))
|
||||
{
|
||||
++ count;
|
||||
}
|
||||
}
|
||||
@ -4457,7 +4460,10 @@ jvmGetDeclaredClasses(Thread* t, uintptr_t* arguments)
|
||||
PROTECT(t, result);
|
||||
|
||||
for (unsigned i = 0; i < arrayLength(t, table); ++i) {
|
||||
if (innerClassReferenceOuter(t, arrayBody(t, table, i))) {
|
||||
object outer = innerClassReferenceOuter(t, arrayBody(t, table, i));
|
||||
if (outer and byteArrayEqual
|
||||
(t, outer, className(t, jclassVmClass(t, *c))))
|
||||
{
|
||||
object inner = getJClass
|
||||
(t, resolveClass
|
||||
(t, classLoader(t, jclassVmClass(t, *c)),
|
||||
|
Loading…
Reference in New Issue
Block a user