]> wimlib.net Git - wimlib/commit
cpu_features.c: fix unconditional execution of xgetbv
authorEric Biggers <ebiggers3@gmail.com>
Thu, 27 Apr 2023 00:35:37 +0000 (17:35 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 27 Apr 2023 00:36:16 +0000 (17:36 -0700)
commit23a2e4ae1f389bdb550cebc894d40879803bc4d1
tree43d609af70e0c0712ad9268aedc4ccb9d39a7e0a
parent97db529847600f65747d437ab2fe0f819e4a363f
cpu_features.c: fix unconditional execution of xgetbv

Ensure that the execution of the xgetbv instruction doesn't get moved
out from under the check for OSXSAVE support by a compiler optimization.
This fixes a crash on older CPUs, introduced in v1.14.0.

Reported at https://wimlib.net/forums/viewtopic.php?p=1527
src/cpu_features.c