Skip to content

Commit 6526a27

Browse files
committed
8371352: [8u] Fix VS2010 build issue in check_code.c
Reviewed-by: phh, andrew
1 parent a8cf6db commit 6526a27

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

jdk/src/share/native/common/check_code.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,10 +1161,11 @@ verify_opcode_operands(context_type *context, unsigned int inumber, int offset)
11611161
case JVM_OPC_if_acmpeq: case JVM_OPC_if_acmpne:
11621162
case JVM_OPC_goto: {
11631163
/* Set the ->operand to be the instruction number of the target. */
1164-
int jump = (((signed char)(code[offset+1])) << 8) + code[offset+2];
1164+
int jump, target;
1165+
jump = (((signed char)(code[offset+1])) << 8) + code[offset+2];
11651166
if (!isLegalOffset(context, offset, jump))
11661167
CCerror(context, "Illegal target of jump or branch");
1167-
int target = offset + jump;
1168+
target = offset + jump;
11681169
this_idata->operand.i = code_data[target];
11691170
break;
11701171
}
@@ -1175,12 +1176,13 @@ verify_opcode_operands(context_type *context, unsigned int inumber, int offset)
11751176
/* FALLTHROUGH */
11761177
case JVM_OPC_goto_w: {
11771178
/* Set the ->operand to be the instruction number of the target. */
1178-
int jump = (((signed char)(code[offset+1])) << 24) +
1179+
int jump, target;
1180+
jump = (((signed char)(code[offset+1])) << 24) +
11791181
(code[offset+2] << 16) + (code[offset+3] << 8) +
11801182
(code[offset + 4]);
11811183
if (!isLegalOffset(context, offset, jump))
11821184
CCerror(context, "Illegal target of jump or branch");
1183-
int target = offset + jump;
1185+
target = offset + jump;
11841186
this_idata->operand.i = code_data[target];
11851187
break;
11861188
}
@@ -1193,6 +1195,7 @@ verify_opcode_operands(context_type *context, unsigned int inumber, int offset)
11931195
int *saved_operand;
11941196
int keys;
11951197
int k, delta;
1198+
int jump, target;
11961199

11971200
if (context->major_version < NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION) {
11981201
/* 4639449, 4647081: Padding bytes must be zero. */
@@ -1219,10 +1222,10 @@ verify_opcode_operands(context_type *context, unsigned int inumber, int offset)
12191222
}
12201223
}
12211224
saved_operand = NEW(int, keys + 2);
1222-
int jump = _ck_ntohl(lpc[0]);
1225+
jump = _ck_ntohl(lpc[0]);
12231226
if (!isLegalOffset(context, offset, jump))
12241227
CCerror(context, "Illegal default target in switch");
1225-
int target = offset + jump;
1228+
target = offset + jump;
12261229
saved_operand[keys + 1] = code_data[target];
12271230
for (k = keys, lptr = &lpc[3]; --k >= 0; lptr += delta) {
12281231
jump = _ck_ntohl(lptr[0]);
@@ -1765,8 +1768,9 @@ isLegalOffset(context_type *context, int bci, int offset)
17651768
int *code_data = context->code_data;
17661769
int max_offset = 65535; // JVMS 4.11
17671770
int min_offset = -65535;
1771+
int target;
17681772
if (offset < min_offset || offset > max_offset) return JNI_FALSE;
1769-
int target = bci + offset;
1773+
target = bci + offset;
17701774
return (target >= 0 && target < code_length && code_data[target] >= 0);
17711775
}
17721776

0 commit comments

Comments
 (0)