Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x86: fix a crash when adding both legacy AMD and CPUID 0x04 caches
The old code increased numcaches in the second case but it added additional caches at the beginning of the array. Uninitialized caches in the array caused a divide by zero (cache->nbthreads_sharing) when used later. Only occurs if the CPUID vendor isn't recognized (neither Intel, nor AMD, nor Zhaoxin) or in case of clang 4.0 bug on FreeBSD11.1 (#282). That's also why the code was crashing on Zhaoxin instead of just reporting wrong topology (#279). Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
- Loading branch information