diff --git a/runtime/bcverify/rtverify.c b/runtime/bcverify/rtverify.c index efaaf5e3526..90daededcc5 100644 --- a/runtime/bcverify/rtverify.c +++ b/runtime/bcverify/rtverify.c @@ -1775,14 +1775,14 @@ verifyBytecodes (J9BytecodeVerificationData * verifyData) goto _inconsistentStack2; } } else { - /* Need to ensure that there is at least an Object reference on the stack for the - * invokeinterface receiver. If the top of stack is a base type or TOP, then - * throw a verify error. The check for the receiver to be an interface occurs in - * the invokeinterface bytecode. - * Note: we need to check whether the Object reference on the stack is initialized - * so as to stop an uninitialized object from being addressed here by invokeinterface. + /* Throw a verify error for any of the following invokeinterface scenarios: + * 1. The top of the stack holds a base type or TOP + * 2. The top of the stack holds an object array + * 3. The Object reference on the stack is uninitialized + * The check for the receiver to be an interface occurs in the bytecode interpreter. */ if ((BCV_TAG_BASE_TYPE_OR_TOP == (type & BCV_TAG_MASK)) + || ((BCV_OBJECT_OR_ARRAY == (type & BCV_TAG_MASK)) && ((type & BCV_ARITY_MASK) > 0)) || J9_ARE_ANY_BITS_SET(type, BCV_SPECIAL) ) { errorType = J9NLS_BCV_ERR_RECEIVER_NOT_COMPATIBLE__ID; diff --git a/runtime/oti/bytecodewalk.h b/runtime/oti/bytecodewalk.h index aac843d28d7..c4b738fe97e 100644 --- a/runtime/oti/bytecodewalk.h +++ b/runtime/oti/bytecodewalk.h @@ -61,10 +61,10 @@ 32bit type => [8 bits arity] [ 19 bits class index] [5 tag bits] tag bits: - special (new / init / ret) - base / object - base type array / regular object, array - null + base type or top of stack (clear bit means object or array) + base type array or null + special init object ("this" for ) + special new object (PC offset in upper 28 bits) base types: (in the 19bit class index field) int