]> git.ipfire.org Git - thirdparty/gcc.git/commit
libphobos: Fix regression d21 loops in getCpuInfo0B in Solaris/x86 kernel zone
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 7 Nov 2023 13:04:07 +0000 (14:04 +0100)
committerIain Buclaw <ibuclaw@gdcproject.org>
Tue, 7 Nov 2023 13:27:23 +0000 (14:27 +0100)
commit47d833394a09068ba0607a57aa149dfe3dc11e8b
treee4cada477946dc74a1bbef84361c4bf6ede2145a
parent37810459f49e6e05dde0befe8e8fb4e02ed9a7f1
libphobos: Fix regression d21 loops in getCpuInfo0B in Solaris/x86 kernel zone

This function assumes that cpuid would return "invalid domain" when a
sub-leaf index greater than what's supported is requested.  This turned
out not to always be the case when running on some virtual machines.

As the loop only does anything for levels 0 and 1, make that a hard
limit for number of times the loop is ran.

    PR d/112408

libphobos/ChangeLog:

* libdruntime/core/cpuid.d (getCpuInfo0B): Limit number of times loop
runs.

(cherry picked from commit 0b25c1295d4e84af681f4b1f4af2ad37cd270da3)
libphobos/libdruntime/core/cpuid.d