< prev index next >
src/java.base/share/native/libverify/check_code.c
Print this page
rev 54010 : 8074817: Resolve disabled warnings for libverify
Reviewed-by: XXX
*** 705,721 ****
--- 705,723 ----
done:
return *pID;
}
+ #ifdef DEBUG
static const char *
ID_to_class_name(context_type *context, unsigned short ID)
{
hash_table_type *class_hash = &(context->class_hash);
hash_bucket_type *bucket = GET_BUCKET(class_hash, ID);
return bucket->name;
}
+ #endif
static jclass
ID_to_class(context_type *context, unsigned short ID)
{
hash_table_type *class_hash = &(context->class_hash);
*** 1388,1398 ****
}
case JVM_OPC_invokedynamic:
CCerror(context,
"invokedynamic bytecode is not supported in this class file version");
!
case JVM_OPC_instanceof:
case JVM_OPC_checkcast:
case JVM_OPC_new:
case JVM_OPC_anewarray:
case JVM_OPC_multianewarray: {
--- 1390,1400 ----
}
case JVM_OPC_invokedynamic:
CCerror(context,
"invokedynamic bytecode is not supported in this class file version");
! break;
case JVM_OPC_instanceof:
case JVM_OPC_checkcast:
case JVM_OPC_new:
case JVM_OPC_anewarray:
case JVM_OPC_multianewarray: {
*** 1697,1707 ****
}
index = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]);
if ((index < 0) || (index > 65535)) {
return -1; /* illegal */
} else {
! return (unsigned char *)(&lpc[index + 4]) - iptr;
}
}
case JVM_OPC_lookupswitch: {
int *lpc = (int *) UCALIGN(iptr + 1);
--- 1699,1711 ----
}
index = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]);
if ((index < 0) || (index > 65535)) {
return -1; /* illegal */
} else {
! unsigned char *finish = (unsigned char *)(&lpc[index + 4]);
! assert(finish >= iptr);
! return (int)(finish - iptr);
}
}
case JVM_OPC_lookupswitch: {
int *lpc = (int *) UCALIGN(iptr + 1);
*** 1712,1723 ****
/* There can't be more than 64K labels because of the limit
* on per-method byte code length.
*/
if (npairs < 0 || npairs >= 65536)
return -1;
! else
! return (unsigned char *)(&lpc[2 * (npairs + 1)]) - iptr;
}
case JVM_OPC_wide:
if (iptr + 1 >= end)
return -1; /* do not read pass the end */
--- 1716,1730 ----
/* There can't be more than 64K labels because of the limit
* on per-method byte code length.
*/
if (npairs < 0 || npairs >= 65536)
return -1;
! else {
! unsigned char *finish = (unsigned char *)(&lpc[2 * (npairs + 1)]);
! assert(finish >= iptr);
! return (int)(finish - iptr);
! }
}
case JVM_OPC_wide:
if (iptr + 1 >= end)
return -1; /* do not read pass the end */
*** 3826,3836 ****
/* Signature must have ';' after the class name.
* If it does not, return 0 and ITEM_Bogus in full_info. */
result = 0;
break;
}
! length = finish - p;
if (length + 1 > (int)sizeof(buffer_space)) {
buffer = malloc(length + 1);
check_and_push(context, buffer, VM_MALLOC_BLK);
}
memcpy(buffer, p, length);
--- 3833,3844 ----
/* Signature must have ';' after the class name.
* If it does not, return 0 and ITEM_Bogus in full_info. */
result = 0;
break;
}
! assert(finish >= p);
! length = (int)(finish - p);
if (length + 1 > (int)sizeof(buffer_space)) {
buffer = malloc(length + 1);
check_and_push(context, buffer, VM_MALLOC_BLK);
}
memcpy(buffer, p, length);
< prev index next >