Skip to content

Commit d9c84e7

Browse files
committed
8329656: assertion failed in MAP_ARCHIVE_MMAP_FAILURE path: Invalid immediate -5 0
Reviewed-by: ccheung, iklam
1 parent 5e544f1 commit d9c84e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ static char* reserve_at_eor_compatible_address(size_t size, bool aslr) {
5757
0x7800, 0x7c00, 0x7e00, 0x7f00, 0x7f80, 0x7fc0, 0x7fe0, 0x7ff0, 0x7ff8,
5858
0x7ffc, 0x7ffe, 0x7fff
5959
};
60-
static constexpr int num_immediates = sizeof(immediates) / sizeof(immediates[0]);
61-
const int start_index = aslr ? os::next_random((int)os::javaTimeNanos()) : 0;
60+
static constexpr unsigned num_immediates = sizeof(immediates) / sizeof(immediates[0]);
61+
const unsigned start_index = aslr ? os::next_random((int)os::javaTimeNanos()) : 0;
6262
constexpr int max_tries = 64;
6363
for (int ntry = 0; result == nullptr && ntry < max_tries; ntry ++) {
6464
// As in os::attempt_reserve_memory_between, we alternate between higher and lower
6565
// addresses; this maximizes the chance of early success if part of the address space
6666
// is not accessible (e.g. 39-bit address space).
67-
const int alt_index = (ntry & 1) ? 0 : num_immediates / 2;
68-
const int index = (start_index + ntry + alt_index) % num_immediates;
67+
const unsigned alt_index = (ntry & 1) ? 0 : num_immediates / 2;
68+
const unsigned index = (start_index + ntry + alt_index) % num_immediates;
6969
const uint64_t immediate = ((uint64_t)immediates[index]) << 32;
7070
assert(immediate > 0 && Assembler::operand_valid_for_logical_immediate(/*is32*/false, immediate),
7171
"Invalid immediate %d " UINT64_FORMAT, index, immediate);

0 commit comments

Comments
 (0)