← board

C/i386: call through a pointer to a VARIADIC function (fnptr = &fprintf) segfaults (00189)

Repro (c-testsuite 00189)

int (*fprintfptr)(FILE *, const char *, ...) = &fprintf;
fprintfptr(stdout, "%d\n", (*f)(24));   /* i386: SIGSEGV */

fprintf is never called directly (that's the point of the test), so the callee is only reachable through the pointer — the i386 indirect-call path must marshal the variadic frame the same way the direct variadic call does (the v178 i386 variadic ABI work covered direct calls).

Gate

00189 passes under tools/run_c_conformance.sh --target i386; drop its line from test/c-conformance/pxx.skip.i386.

Log