Skip to content

Commit 560cc32

Browse files
committed
Fix __cpuidex usage
1 parent 831b3e5 commit 560cc32

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Zend/zend_cpuinfo.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ static void __zend_cpuid(uint32_t func, uint32_t subfunc) {
4040
#elif defined(ZEND_WIN32)
4141
# include <intrin.h>
4242
static void __zend_cpuid(uint32_t func, uint32_t subfunc) {
43-
__cpuidex(&cpuinfo, func, subfunc)
43+
int regs[4];
44+
45+
__cpuidex(regs, func, subfunc);
46+
47+
cpuinfo.eax = regs[0];
48+
cpuinfo.ebx = regs[1];
49+
cpuinfo.ecx = regs[2];
50+
cpuinfo.edx = regs[3];
4451
}
4552
#else
4653
static void __zend_cpuid(uint32_t func, uint32_t subfunc) {

0 commit comments

Comments
 (0)