8336346: Fix -Wzero-as-null-pointer-constant warnings in jvmciJavaClasses.cpp

Reviewed-by: jwaters, thartmann
This commit is contained in:
Kim Barrett 2024-07-18 15:24:51 +00:00
parent 4a73ed44f1
commit 5f7b0072cf

View File

@ -584,7 +584,7 @@ void JNIJVMCI::register_natives(JNIEnv* env) {
#define EMPTY2(x,y)
#define FIELD3(className, name, sig) FIELD2(className, name)
#define FIELD2(className, name) \
jfieldID JNIJVMCI::className::_##name##_field_id = 0; \
jfieldID JNIJVMCI::className::_##name##_field_id = nullptr; \
int HotSpotJVMCI::className::_##name##_offset = 0;
#define METHOD(jniCallType, jniGetMethod, hsCallType, returnType, className, methodName, signatureSymbolName)
#define CONSTRUCTOR(className, signature)
@ -626,7 +626,7 @@ JVMCI_CLASSES_DO(EMPTY2, EMPTY0, FIELD2, FIELD2, FIELD2, FIELD2, FIELD2, FIELD3,
void JNIJVMCI::className::check(JVMCIEnv* jvmciEnv, JVMCIObject obj, const char* field_name, jfieldID offset) { \
assert(obj.is_non_null(), "null field access of %s.%s", #className, field_name); \
assert(jvmciEnv->isa_##className(obj), "wrong class, " #className " expected, found %s", jvmciEnv->klass_name(obj)); \
assert(offset != 0, "must be valid offset"); \
assert(offset != nullptr, "must be valid offset"); \
} \
jclass JNIJVMCI::className::_class = nullptr;