Skip to content

Commit 4a935f6

Browse files
committed
Fix out-of-bounds access in AVX register handling on some CPUs
1 parent 18077ca commit 4a935f6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/ExtraRegisters.cc‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ struct RegisterDescriptor {
101101
}
102102

103103
bool describes_register(GdbServerRegister gdb_register) const {
104+
const auto& layout = xsave_native_layout();
105+
if (!(layout.supported_feature_bits & (1ULL << feature))) {
106+
return false;
107+
}
104108
// compare end first because we search table linerarly.
105109
return gdb_register <= end_inclusive && gdb_register >= base;
106110
}

0 commit comments

Comments
 (0)