-
Notifications
You must be signed in to change notification settings - Fork 740
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
Error if invokeinterface receiver is reference array #19877
Conversation
Did you run verification tests with this change? |
runtime/oti/bytecodewalk.h
Outdated
#define BCV_TAG_BASE_ARRAY_OR_NULL 2 /* set bit means base type array */ | ||
#define BCV_SPECIAL_INIT 4 /* set bit means special init object ("this" for <init>) */ | ||
#define BCV_SPECIAL_NEW 8 /* set bit means special new object (PC offset in upper 28 bits) */ | ||
#define BCV_OBJECT_OR_ARRAY 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to leave these comments out there to avoid any confusion/misconception in the future given it's clearer for developers to understand how to use these constants with the comments put aside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I was thinking it would be good to have one set of comments, but I don't think there's a risk of this code changing significantly :) I'll add them back.
@theresa-m, you will need to run internal & open builds to ensure there is no issue introduced with your changes. In addition, please share with us the output of OpenJ9 with the updated fix as compared to RI. |
1c349ba
to
0893ddc
Compare
The output of OpenJ9 for the test provided in the issue is:
|
I will approve the PR once it passes all related internal & open test cases. |
I updated this change after further testing to make sure the type is not BCV_BASE_TYPE_NULL since BCV_BASE_TYPE_NULL has non-zero arity bits. |
That's correct as a NULL value belongs to reference as per the VM Spec. |
Throw an error during bytecode verification if the receiver of invokeinterface is a reference array Signed-off-by: Theresa Mammarella <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
jenkins test sanity alinux64 jdk8,jdk21 |
@theresa-m Please make a 0.47 PR as well |
#19931 is for 0.47 |
Throw an error during bytecode verification if the receiver of invokeinterface is a reference array.
Fix: #19756