Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ void VM_Version::os_aux_features() {
}

VM_Version::VM_MODE VM_Version::parse_satp_mode(const char* vm_mode) {
if (!strcmp(vm_mode, "sv39")) {
if (!strncmp(vm_mode, "sv39", sizeof "sv39" - 1)) {
return VM_SV39;
} else if (!strcmp(vm_mode, "sv48")) {
} else if (!strncmp(vm_mode, "sv48", sizeof "sv48" - 1)) {
return VM_SV48;
} else if (!strcmp(vm_mode, "sv57")) {
} else if (!strncmp(vm_mode, "sv57", sizeof "sv57" - 1)) {
return VM_SV57;
} else if (!strcmp(vm_mode, "sv64")) {
} else if (!strncmp(vm_mode, "sv64", sizeof "sv64" - 1)) {
return VM_SV64;
} else {
return VM_MBARE;
Expand All @@ -196,7 +196,7 @@ char* VM_Version::os_uarch_additional_features() {
if ((p = strchr(buf, ':')) != nullptr) {
if (mode == VM_NOTSET) {
if (strncmp(buf, "mmu", sizeof "mmu" - 1) == 0) {
mode = VM_Version::parse_satp_mode(p);
mode = VM_Version::parse_satp_mode(p + 2);
}
}
if (ret == nullptr) {
Expand Down