From: Tudor Brindus Date: Sat, 2 May 2020 02:24:20 +0000 (-0400) Subject: Fix segmentation fault in CPUID check X-Git-Tag: json-c-0.15-20200726~60^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F590%2Fhead;p=thirdparty%2Fjson-c.git Fix segmentation fault in CPUID check --- diff --git a/random_seed.c b/random_seed.c index fc19e26d..c459f0f9 100644 --- a/random_seed.c +++ b/random_seed.c @@ -26,19 +26,8 @@ static void do_cpuid(int regs[], int h) { /* clang-format off */ - __asm__ __volatile__( -#if defined __x86_64__ - "pushq %%rbx;\n" -#else - "pushl %%ebx;\n" -#endif - "cpuid;\n" -#if defined __x86_64__ - "popq %%rbx;\n" -#else - "popl %%ebx;\n" -#endif - : "=a"(regs[0]), [ebx] "=r"(regs[1]), "=c"(regs[2]), "=d"(regs[3]) + __asm__ __volatile__("cpuid" + : "=a"(regs[0]), "=b"(regs[1]), "=c"(regs[2]), "=d"(regs[3]) : "a"(h)); /* clang-format on */ }