File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -1775,14 +1775,15 @@ verifyBytecodes (J9BytecodeVerificationData * verifyData)
1775
1775
goto _inconsistentStack2 ;
1776
1776
}
1777
1777
} else {
1778
- /* Need to ensure that there is at least an Object reference on the stack for the
1779
- * invokeinterface receiver. If the top of stack is a base type or TOP, then
1780
- * throw a verify error. The check for the receiver to be an interface occurs in
1781
- * the invokeinterface bytecode .
1782
- * Note: we need to check whether the Object reference on the stack is initialized
1783
- * so as to stop an uninitialized object from being addressed here by invokeinterface .
1778
+ /* Throw a verify error for any of the following invokeinterface scenarios:
1779
+ * 1. The top of the stack holds a base type or TOP
1780
+ * 2. The top of the stack holds an array. Null type has a different meaning for arity bits.
1781
+ * Don't fail at this point, a NullPointerException is expected later on .
1782
+ * 3. The Object reference on the stack is uninitialized
1783
+ * The check for the receiver to be an interface occurs in the bytecode interpreter .
1784
1784
*/
1785
1785
if ((BCV_TAG_BASE_TYPE_OR_TOP == (type & BCV_TAG_MASK ))
1786
+ || ((type != BCV_BASE_TYPE_NULL ) && (BCV_ARITY_FROM_TYPE (type ) > 0 ))
1786
1787
|| J9_ARE_ANY_BITS_SET (type , BCV_SPECIAL )
1787
1788
) {
1788
1789
errorType = J9NLS_BCV_ERR_RECEIVER_NOT_COMPATIBLE__ID ;
Original file line number Diff line number Diff line change 61
61
32bit type => [8 bits arity] [ 19 bits class index] [5 tag bits]
62
62
63
63
tag bits:
64
- special (new / init / ret )
65
- base / object
66
- base type array / regular object, array
67
- null
64
+ base type or top of stack (clear bit means object or array )
65
+ base type array or null
66
+ special init object ("this" for <init>)
67
+ special new object (PC offset in upper 28 bits)
68
68
69
69
base types: (in the 19bit class index field)
70
70
int
You can’t perform that action at this time.
0 commit comments