Skip to content

Use getCanonicalName() for array codegen in autofuzz reproducers#1043

Open
kyakdan wants to merge 1 commit intomainfrom
fix-autofuzz-reproducer
Open

Use getCanonicalName() for array codegen in autofuzz reproducers#1043
kyakdan wants to merge 1 commit intomainfrom
fix-autofuzz-reproducer

Conversation

@kyakdan
Copy link
Member

@kyakdan kyakdan commented Feb 16, 2026

Fixes #1026

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issue #1026 where autofuzz generates invalid Java code for multi-dimensional arrays. The problem occurs because Class#getName() returns JVM type descriptors (e.g., [I for int[]) instead of valid Java source syntax. The fix changes the array codegen to use Class#getCanonicalName() which returns the proper Java source representation.

Changes:

  • Updated array codegen in Meta.java to use getCanonicalName() instead of getName()
  • Added regression test target class with multi-dimensional array and inner class array parameters
  • Added integration and unit tests to verify the fix

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/main/java/com/code_intelligence/jazzer/autofuzz/Meta.java Changed array type codegen to use getCanonicalName() for proper Java source syntax
tests/src/test/java/com/example/AutofuzzMultiDimArrayTarget.java Added regression test target with multi-dimensional arrays and inner class arrays
tests/BUILD.bazel Added integration test for the multi-dimensional array fix
src/test/java/com/code_intelligence/jazzer/autofuzz/MetaTest.java Added unit tests for multi-dimensional array and inner class array codegen

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Autofuzz generates invalid code for multi-dimensional array

1 participant