-
Bug
-
Resolution: Fixed
-
P4
-
14, 15, 16, 17
-
b14
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8263874 | 16.0.2 | Harold Seigel | P4 | Resolved | Fixed | b01 |
SonarCloud instance reports problems like:
The left operand of '==' is a garbage value
C2V_VMENTRY_NULL(jobject, getResolvedJavaMethod, (JNIEnv* env, jobject, jobject base, jlong offset))
Method* method;
...
if (method == NULL) { // <--- here
JVMCI_THROW_MSG_NULL(IllegalArgumentException, err_msg("Unexpected type: %s", JVMCIENV->klass_name(base_object)));
}
I believe this is caused by refactoring inJDK-8233913 that replaced `methodHandle` with naked `Method*`. `methodHandle` is implicitly initialized to null, while naked variable is not. After reading the original changeset, I found two other places where the same thing happens.
The left operand of '==' is a garbage value
C2V_VMENTRY_NULL(jobject, getResolvedJavaMethod, (JNIEnv* env, jobject, jobject base, jlong offset))
Method* method;
...
if (method == NULL) { // <--- here
JVMCI_THROW_MSG_NULL(IllegalArgumentException, err_msg("Unexpected type: %s", JVMCIENV->klass_name(base_object)));
}
I believe this is caused by refactoring in
- backported by
-
JDK-8263874 Uninitialized Method* variables after JDK-8233913
- Resolved
- relates to
-
JDK-8233913 Remove implicit conversion from Method* to methodHandle
- Resolved
- links to
-
Commit openjdk/jdk16u/db7b1c9d
-
Commit openjdk/jdk/e25ad730
-
Review openjdk/jdk16u/89
-
Review openjdk/jdk/2936
(1 links to)