File tree 1 file changed +5
-5
lines changed
src/hotspot/os_cpu/linux_riscv
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -168,13 +168,13 @@ void VM_Version::os_aux_features() {
168
168
}
169
169
170
170
VM_Version::VM_MODE VM_Version::parse_satp_mode (const char * vm_mode) {
171
- if (!strcmp (vm_mode, " sv39" )) {
171
+ if (!strncmp (vm_mode, " sv39" , sizeof " sv39 " - 1 )) {
172
172
return VM_SV39;
173
- } else if (!strcmp (vm_mode, " sv48" )) {
173
+ } else if (!strncmp (vm_mode, " sv48" , sizeof " sv48 " - 1 )) {
174
174
return VM_SV48;
175
- } else if (!strcmp (vm_mode, " sv57" )) {
175
+ } else if (!strncmp (vm_mode, " sv57" , sizeof " sv57 " - 1 )) {
176
176
return VM_SV57;
177
- } else if (!strcmp (vm_mode, " sv64" )) {
177
+ } else if (!strncmp (vm_mode, " sv64" , sizeof " sv64 " - 1 )) {
178
178
return VM_SV64;
179
179
} else {
180
180
return VM_MBARE;
@@ -196,7 +196,7 @@ char* VM_Version::os_uarch_additional_features() {
196
196
if ((p = strchr (buf, ' :' )) != nullptr ) {
197
197
if (mode == VM_NOTSET) {
198
198
if (strncmp (buf, " mmu" , sizeof " mmu" - 1 ) == 0 ) {
199
- mode = VM_Version::parse_satp_mode (p);
199
+ mode = VM_Version::parse_satp_mode (p + 2 );
200
200
}
201
201
}
202
202
if (ret == nullptr ) {
You can’t perform that action at this time.
0 commit comments