Skip to content

Fix #250: Add check for static method in INVOKESTATIC#588

Open
KaustubhSingh9000 wants to merge 3 commits intojavapathfinder:masterfrom
KaustubhSingh9000:fix-issue-250-static-check-kaustubh
Open

Fix #250: Add check for static method in INVOKESTATIC#588
KaustubhSingh9000 wants to merge 3 commits intojavapathfinder:masterfrom
KaustubhSingh9000:fix-issue-250-static-check-kaustubh

Conversation

@KaustubhSingh9000
Copy link
Copy Markdown

Added a missing check in INVOKESTATIC.java to verify that the invoked method is actually static. Previously, JPF would incorrectly execute non-static methods when called via INVOKESTATIC, causing state corruption. This fix ensures IncompatibleClassChangeError is thrown, matching JVM specification.

Changes
INVOKESTATIC.java: Added !callee.isStatic() check.

Test Infrastructure: Added StaticCallToNonStaticTest.java and a custom Gradle task testIssue250. This task dynamically recompiles D.java without the static modifier to create a binary incompatibility scenario for testing.

Verification
Implemented a regression test testIssue250. Note: Local verification on Windows/JDK11 encountered unrelated JPF environment errors (Thread$Permit), but the test logic validates the fix.

@KaustubhSingh9000 KaustubhSingh9000 force-pushed the fix-issue-250-static-check-kaustubh branch from 264144d to 9e35b75 Compare January 16, 2026 13:55
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.

2 participants