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 @@ -169,13 +169,13 @@ void VM_Version::os_aux_features() {
169
169
}
170
170
171
171
VM_Version::VM_MODE VM_Version::parse_satp_mode (const char * vm_mode) {
172
- if (!strcmp (vm_mode, " sv39" )) {
172
+ if (!strncmp (vm_mode, " sv39" , sizeof " sv39 " - 1 )) {
173
173
return VM_SV39;
174
- } else if (!strcmp (vm_mode, " sv48" )) {
174
+ } else if (!strncmp (vm_mode, " sv48" , sizeof " sv48 " - 1 )) {
175
175
return VM_SV48;
176
- } else if (!strcmp (vm_mode, " sv57" )) {
176
+ } else if (!strncmp (vm_mode, " sv57" , sizeof " sv57 " - 1 )) {
177
177
return VM_SV57;
178
- } else if (!strcmp (vm_mode, " sv64" )) {
178
+ } else if (!strncmp (vm_mode, " sv64" , sizeof " sv64 " - 1 )) {
179
179
return VM_SV64;
180
180
} else {
181
181
return VM_MBARE;
@@ -197,7 +197,7 @@ char* VM_Version::os_uarch_additional_features() {
197
197
if ((p = strchr (buf, ' :' )) != nullptr ) {
198
198
if (mode == VM_NOTSET) {
199
199
if (strncmp (buf, " mmu" , sizeof " mmu" - 1 ) == 0 ) {
200
- mode = VM_Version::parse_satp_mode (p);
200
+ mode = VM_Version::parse_satp_mode (p + 2 );
201
201
}
202
202
}
203
203
if (ret == nullptr ) {
You can’t perform that action at this time.
0 commit comments