< prev index next >

src/java.base/share/native/libverify/check_code.c

Print this page

2145                 if (top_type != MAKE_FULLINFO(ITEM_Integer, 0, 0))
2146                     CCerror(context, "Expecting to find integer on stack");
2147                 break;
2148 
2149             case 'F':
2150                 if (top_type != MAKE_FULLINFO(ITEM_Float, 0, 0))
2151                     CCerror(context, "Expecting to find float on stack");
2152                 break;
2153 
2154             case 'A':           /* object or array */
2155                 if (   (GET_ITEM_TYPE(top_type) != ITEM_Object)
2156                     && (GET_INDIRECTION(top_type) == 0)) {
2157                     /* The thing isn't an object or an array.  Let's see if it's
2158                      * one of the special cases  */
2159                     if (  (WITH_ZERO_EXTRA_INFO(top_type) ==
2160                                 MAKE_FULLINFO(ITEM_ReturnAddress, 0, 0))
2161                         && (opcode == JVM_OPC_astore))
2162                         break;
2163                     if (   (GET_ITEM_TYPE(top_type) == ITEM_NewObject
2164                             || (GET_ITEM_TYPE(top_type) == ITEM_InitObject))
2165                         && ((opcode == JVM_OPC_astore) || (opcode == JVM_OPC_aload)
2166                             || (opcode == JVM_OPC_ifnull) || (opcode == JVM_OPC_ifnonnull)))
2167                         break;
2168                     /* The 2nd edition VM of the specification allows field
2169                      * initializations before the superclass initializer,
2170                      * if the field is defined within the current class.
2171                      */
2172                      if (   (GET_ITEM_TYPE(top_type) == ITEM_InitObject)
2173                          && (opcode == JVM_OPC_putfield)) {
2174                         int operand = this_idata->operand.i;
2175                         int access_bits = JVM_GetCPFieldModifiers(context->env,
2176                                                                   context->class,
2177                                                                   operand,
2178                                                                   context->class);
2179                         /* Note: This relies on the fact that
2180                          * JVM_GetCPFieldModifiers retrieves only local fields,
2181                          * and does not respect inheritance.
2182                          */
2183                         if (access_bits != -1) {
2184                             if ( cp_index_to_class_fullinfo(context, operand, JVM_CONSTANT_Fieldref) ==
2185                                  context->currentclass_info ) {
2186                                 top_type = context->currentclass_info;

2145                 if (top_type != MAKE_FULLINFO(ITEM_Integer, 0, 0))
2146                     CCerror(context, "Expecting to find integer on stack");
2147                 break;
2148 
2149             case 'F':
2150                 if (top_type != MAKE_FULLINFO(ITEM_Float, 0, 0))
2151                     CCerror(context, "Expecting to find float on stack");
2152                 break;
2153 
2154             case 'A':           /* object or array */
2155                 if (   (GET_ITEM_TYPE(top_type) != ITEM_Object)
2156                     && (GET_INDIRECTION(top_type) == 0)) {
2157                     /* The thing isn't an object or an array.  Let's see if it's
2158                      * one of the special cases  */
2159                     if (  (WITH_ZERO_EXTRA_INFO(top_type) ==
2160                                 MAKE_FULLINFO(ITEM_ReturnAddress, 0, 0))
2161                         && (opcode == JVM_OPC_astore))
2162                         break;
2163                     if (   (GET_ITEM_TYPE(top_type) == ITEM_NewObject
2164                             || (GET_ITEM_TYPE(top_type) == ITEM_InitObject))
2165                         && ((opcode == JVM_OPC_astore) || (opcode == JVM_OPC_aload)))

2166                         break;
2167                     /* The 2nd edition VM of the specification allows field
2168                      * initializations before the superclass initializer,
2169                      * if the field is defined within the current class.
2170                      */
2171                      if (   (GET_ITEM_TYPE(top_type) == ITEM_InitObject)
2172                          && (opcode == JVM_OPC_putfield)) {
2173                         int operand = this_idata->operand.i;
2174                         int access_bits = JVM_GetCPFieldModifiers(context->env,
2175                                                                   context->class,
2176                                                                   operand,
2177                                                                   context->class);
2178                         /* Note: This relies on the fact that
2179                          * JVM_GetCPFieldModifiers retrieves only local fields,
2180                          * and does not respect inheritance.
2181                          */
2182                         if (access_bits != -1) {
2183                             if ( cp_index_to_class_fullinfo(context, operand, JVM_CONSTANT_Fieldref) ==
2184                                  context->currentclass_info ) {
2185                                 top_type = context->currentclass_info;
< prev index next >