Skip to content

Commit

Permalink
8324184: Windows VS2010 build failed with "error C2275: 'int64_t'"
Browse files Browse the repository at this point in the history
Reviewed-by: serb
Backport-of: 4f80edfae10e83f2709f297a553d2128712e4b51
  • Loading branch information
gnu-andrew committed Jan 29, 2024
1 parent 82a1501 commit 26d795d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/java.base/share/native/libverify/check_code.c
Expand Up @@ -1693,12 +1693,13 @@ static int instruction_length(unsigned char *iptr, unsigned char *end)
switch (instruction) {
case JVM_OPC_tableswitch: {
int *lpc = (int *)UCALIGN(iptr + 1);
int64_t low, high, index;
if (lpc + 2 >= (int *)end) {
return -1; /* do not read pass the end */
}
int64_t low = _ck_ntohl(lpc[1]);
int64_t high = _ck_ntohl(lpc[2]);
int64_t index = high - low;
low = _ck_ntohl(lpc[1]);
high = _ck_ntohl(lpc[2]);
index = high - low;
// The value of low must be less than or equal to high - i.e. index >= 0
if ((index < 0) || (index > 65535)) {
return -1; /* illegal */
Expand Down

1 comment on commit 26d795d

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.