Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

filter InnerClasses attribute for relevant classes in JVM_GetDeclared…

…Classes

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.
  • Loading branch information...
commit e3fe9099a2329c3ed380ac38a426944fda79aed8 1 parent 63ee3ab
@dicej dicej authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/classpath-openjdk.cpp
View
10 src/classpath-openjdk.cpp
@@ -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)),
Please sign in to comment.
Something went wrong with that request. Please try again.