Skip to content

[JVM] Handle array component mirrors and reflective allocation safely - #552

Merged
CaelmBleidd merged 4 commits into
mainfrom
caelmbleidd/jvm-array-component-type
Oct 16, 2026
Merged

CaelmBleidd merged 4 commits into
mainfrom
caelmbleidd/jvm-array-component-type

Conversation

@CaelmBleidd

@CaelmBleidd CaelmBleidd commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Reflective array allocation could abort when Class.getComponentType read uninitialized JDK mirror fields, or when an input Class carried symbolic synthetic metadata. Resolve component classes from the engine's known type representatives, returning null for non-array classes. When a representative is unavailable, decline the approximation and let the existing execution path handle the call instead of casting symbolic metadata to a concrete reference.

Apply the same metadata contract to Array.newInstance and check its null component argument before reading memory, producing the modeled NullPointerException.

Validation: 11 focused tests pass with the pinned JacoDB. They cover primitive/reference/nested arrays, non-array/primitive/void/interface classes, reflective allocation/copying, raw symbolic Class inputs, and the null-component exception. The symbolic-metadata and null-component regressions fail before their respective fixes. Symbolic Class-input tests check machine execution without concrete Class reconstruction.

On the unchanged real ArrayUtils bytecode and full class denominator, the final ON diagnostic reaches 4279/5175 class-owned IR points with 2851 normal symbolic terminations and stops by timeout without an engine failure. getComponentType and Array.newInstance approximations execute 180 and 194 times. The configured budget is 10s and the machine loop takes 10.012s; the outer analysis timer is 12.950s and also includes machine construction and surrounding work. Native replay was disabled, so these are symbolic reachability/results, not native coverage or concrete correctness claims.

@CaelmBleidd CaelmBleidd changed the title Resolve JVM array component classes from symbolic Class metadata [JVM] Handle array component mirrors and reflective allocation safely Oct 16, 2026
@CaelmBleidd
CaelmBleidd merged commit ed7e18c into main Oct 16, 2026
6 checks passed
@CaelmBleidd
CaelmBleidd deleted the caelmbleidd/jvm-array-component-type branch October 16, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant