Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: Fix ClassCastException for primitive compare calls #792

Merged
merged 1 commit into from
Jul 10, 2023
Merged

runtime: Fix ClassCastException for primitive compare calls #792

merged 1 commit into from
Jul 10, 2023

Conversation

fmeum
Copy link
Contributor

@fmeum fmeum commented Jul 5, 2023

Previously, calls to {Byte,Short}.compare{Unsigned,} resulted in exceptions such as the following:

java.lang.ClassCastException: class java.lang.Short cannot be cast to class java.lang.Integer (java.lang.Short and java.lang.Integer are in module java.base of loader 'bootstrap')
	at com.code_intelligence.jazzer.runtime.TraceCmpHooks.integerCompare(TraceCmpHooks.java:40)
        ...

Fixes #790

Copy link
Contributor

@bertschneider bertschneider left a comment

Choose a reason for hiding this comment

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

LGTM.

I couldn't find any other place with this "problematic cast pattern".

Previously, calls to `{Byte,Short}.compare{Unsigned,}` resulted in
exceptions such as the following:

```
java.lang.ClassCastException: class java.lang.Short cannot be cast to class java.lang.Integer (java.lang.Short and java.lang.Integer are in module java.base of loader 'bootstrap')
	at com.code_intelligence.jazzer.runtime.TraceCmpHooks.integerCompare(TraceCmpHooks.java:40)
        ...
```
@fmeum fmeum enabled auto-merge (rebase) July 10, 2023 13:03
@fmeum fmeum merged commit d242322 into CodeIntelligenceTesting:main Jul 10, 2023
@fmeum fmeum deleted the FUZZ-749-short-class-cast branch July 10, 2023 13:58
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.

java.lang.ClassCastException: class java.lang.Short cannot be cast to class java.lang.Integer with jUnit tests
2 participants