Skip to content

Commit ee90110

Browse files
authored
Merge pull request json-c#590 from Xyene/fix-cpuid-segfault
Fix segmentation fault in CPUID check
2 parents f9605e9 + 0e5bbca commit ee90110

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

random_seed.c

+2-13
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,8 @@
2626
static void do_cpuid(int regs[], int h)
2727
{
2828
/* clang-format off */
29-
__asm__ __volatile__(
30-
#if defined __x86_64__
31-
"pushq %%rbx;\n"
32-
#else
33-
"pushl %%ebx;\n"
34-
#endif
35-
"cpuid;\n"
36-
#if defined __x86_64__
37-
"popq %%rbx;\n"
38-
#else
39-
"popl %%ebx;\n"
40-
#endif
41-
: "=a"(regs[0]), [ebx] "=r"(regs[1]), "=c"(regs[2]), "=d"(regs[3])
29+
__asm__ __volatile__("cpuid"
30+
: "=a"(regs[0]), "=b"(regs[1]), "=c"(regs[2]), "=d"(regs[3])
4231
: "a"(h));
4332
/* clang-format on */
4433
}

0 commit comments

Comments
 (0)