Skip to content

Commit a4122e5

Browse files
bernhardurocallahan
authored andcommitted
Add at least the first two feature_layouts in xsave_layout_from_trace.
This fixes a regression introduced by 2c1d0b2, which gets only visible if no supported_feature_bits are set above the first two bits, which is the case for a Intel Pentium B950 from 2011. There it surfaces in the tcp_sockets test, with the dump crashing.
1 parent 7592750 commit a4122e5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/util.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,6 +1635,10 @@ XSaveLayout xsave_layout_from_trace(const std::vector<CPUIDRecord> records) {
16351635
layout.supported_feature_bits =
16361636
cpuid_data.out.eax | (uint64_t(cpuid_data.out.edx) << 32);
16371637

1638+
// Add at least the first two entries in case there are no feature_bits set above 2
1639+
while (layout.feature_layouts.size() < 2) {
1640+
layout.feature_layouts.push_back({ 0, 0 });
1641+
}
16381642
for (size_t i = 2; i < 64; ++i) {
16391643
if (layout.supported_feature_bits & (uint64_t(1) << i)) {
16401644
do {

0 commit comments

Comments
 (0)