8317331: Solaris build failed with "declaration can not follow a statement (E_DECLARATION_IN_CODE)"
Backport-of: 852276d1f833d49802693f2a5a82ba6eb2722de6
This commit is contained in:
parent
fff750c99d
commit
fac49b8375
@ -1678,12 +1678,13 @@ static int instruction_length(unsigned char *iptr, unsigned char *end)
|
|||||||
switch (instruction) {
|
switch (instruction) {
|
||||||
case JVM_OPC_tableswitch: {
|
case JVM_OPC_tableswitch: {
|
||||||
int *lpc = (int *)UCALIGN(iptr + 1);
|
int *lpc = (int *)UCALIGN(iptr + 1);
|
||||||
|
int64_t low, high, index;
|
||||||
if (lpc + 2 >= (int *)end) {
|
if (lpc + 2 >= (int *)end) {
|
||||||
return -1; /* do not read pass the end */
|
return -1; /* do not read pass the end */
|
||||||
}
|
}
|
||||||
int64_t low = _ck_ntohl(lpc[1]);
|
low = _ck_ntohl(lpc[1]);
|
||||||
int64_t high = _ck_ntohl(lpc[2]);
|
high = _ck_ntohl(lpc[2]);
|
||||||
int64_t index = high - low;
|
index = high - low;
|
||||||
// The value of low must be less than or equal to high - i.e. index >= 0
|
// The value of low must be less than or equal to high - i.e. index >= 0
|
||||||
if ((index < 0) || (index > 65535)) {
|
if ((index < 0) || (index > 65535)) {
|
||||||
return -1; /* illegal */
|
return -1; /* illegal */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user